The state of child-thread is always STILL_ACTIVE
-
Hello all, The child-thread ends (I trace and find it calls "endthreadex()"). But why in the parent thread, after the childthread ends, the function GetExitCodeThread(ChildThreadHandle, ...) returns TRUE, and the ExitCode = "STILL_ACTIVE" ? Does the child-thread really end ? If it not, why? The function WaitForSingleObject() which waits the child-thread to end also can't return. Thanks a lot
-
Hello all, The child-thread ends (I trace and find it calls "endthreadex()"). But why in the parent thread, after the childthread ends, the function GetExitCodeThread(ChildThreadHandle, ...) returns TRUE, and the ExitCode = "STILL_ACTIVE" ? Does the child-thread really end ? If it not, why? The function WaitForSingleObject() which waits the child-thread to end also can't return. Thanks a lot
To quote from the documentation for _endthreadex... "Like the Win32 ExitThread API, _endthreadex does not close the thread handle. Therefore, when you use _beginthreadex and _endthreadex, you must close the thread handle by calling the Win32 CloseHandle API." This may answer your question. Iain.