[thread] WinCE change for externally_launched_thread

It appears that if you pass the GetCurrentThread() pseudo-handle into DuplicateHandle on WinCE, it will trigger an error rather than creating an actual handle for the current thread. Instead, the convention on WinCE appears to involve using the value from GetCurrentThreadId() as the thread handle (apparently this where the ID comes from under the hood on WinCE). Attached is a patch that substitutes this behavior in externally_launched_thread() when building on Windows CE. Thanks, -Dave

David Deakins <ddeakins <at> veeco.com> writes:
It appears that if you pass the GetCurrentThread() pseudo-handle into DuplicateHandle on WinCE, it will trigger an error rather than creating an actual handle for the current thread. Instead, the convention on WinCE appears to involve using the value from GetCurrentThreadId() as the thread handle (apparently this where the ID comes from under the hood on WinCE). Attached is a patch that substitutes this behavior in externally_launched_thread() when building on Windows CE.
Actually, I'm not sure we need the thread handle for externally launched threads anyway. The only use is so self() can return a joinable handle, but I intend to remove self() anyway, as it doesn't work on POSIX, and it violates the one-thread-object-per-thread principle. Anthony
participants (2)
-
Anthony Williams
-
David Deakins