Why I see a few "Stream 0x22c8 exited with code 259 (0x103)." Messages

I get a lot of these messages in my Winforms application, although I have never explicitly made any threads. Why is this happening? I was looking for an explanation, but it was difficult for me to talk about such a question.

I am using Visual Studios 2013 and this is the debugging result I'm worried about:

The thread 0x23a4 has exited with code 259 (0x103). The thread 0x2884 has exited with code 259 (0x103). The thread 0x27ec has exited with code 259 (0x103). The thread 0x1978 has exited with code 259 (0x103). The thread 0x1534 has exited with code 259 (0x103). The thread 0x1ad8 has exited with code 259 (0x103). The thread 0x2938 has exited with code 259 (0x103). The thread 0x22c8 has exited with code 259 (0x103). 
+58
multithreading c # visual-studio exit-code
Mar 14 '14 at 3:07
source share
1 answer

From the MSDN documentation:

Note

This function returns immediately. If the specified thread is not completed and the function succeeds, the returned status is STILL_ACTIVE. If the thread is completed and the function is successful, the return status is one of the following values: The output value specified in the ExitThread or TerminateThread function. Return value from stream function. Process output value to process. Important. The GetExitCodeThread function returns a valid error code defined by the application only after the thread completes. Therefore, the application should not use STILL_ACTIVE (259) as an error code. If a thread returns STILL_ACTIVE (259) as an error code, applications that check this value can interpret it, meaning that the thread is still running and continues to test the end of the thread after the thread terminates, which could put the application in an infinite loop.

So basically it checks the current thread all the time from time to time.

This seems to be a bug:

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

+56
Mar 14 '14 at 3:24
source share



All Articles