Why am I seeing multiple "The thread 0x22c8 has exited with code 259 (0x103)." messages Why am I seeing multiple "The thread 0x22c8 has exited with code 259 (0x103)." messages multithreading multithreading

Why am I seeing multiple "The thread 0x22c8 has exited with code 259 (0x103)." messages


From MSDN Documentation:

Remarks

This function returns immediately. If the specified thread has not terminated and the function succeeds, the status returned is STILL_ACTIVE. If the thread has terminated and the function succeeds, the status returned is one of the following values: The exit value specified in the ExitThread or TerminateThread function. The return value from the thread function. The exit value of the thread's process. Important The GetExitCodeThread function returns a valid error code defined by the application only after the thread terminates. Therefore, an application should not use STILL_ACTIVE (259) as an error code. If a thread returns STILL_ACTIVE (259) as an error code, applications that test for this value could interpret it to mean that the thread is still running and continue to test for the completion of the thread after the thread has terminated, which could put the application into an infinite loop.

So basically it's still checking current thread from time to time.

It seems to be a bug:

http://connect.microsoft.com/VisualStudio/feedback/details/812144/vs2013-reports-incorrect-thread-exit-code