- thread exits but not signaled
- Posted by luca.toffanin@gmail.com on May 17th, 2007
Hi, i'm fighting with this problem:
in a multithread process a thread is communicating over a Virtual COM
port. At the end of communication activity, it closes COM and returns
from thred's function: sometimes happens that after thread exit
(thread function returns) it's state it's not signaled:
WaitForSingleObject return for timeout and GetExitCodeThread returns
STILL_ACTIVE. For test i insert a call to TerminateThread but it
fails(return ERROR_INVALID_PARAMETER) and after GetExitCodeThread
still return STILL_ACTIVE.
Question:
1. why my thread exits but not it's not signaled?
2. why TerminateThread fails?
3. Could an error on Virtual COM Port driver (maybe in CloseHandle)
causes this effect?
- Posted by Sten Westerback \(MVP SDK 2005-6 :\) on June 1st, 2007
<luca.toffanin@gmail.com> wrote in message
news:1179396571.000423.246310@e65g2000hsc.googlegr oups.com...
properly, eg. you are actually checking another thread or kernel object. At
least i can't see any reason why it wouldn't exit unless you somehow have
corrupted the CRT so that it actually can't return. I assume you are using
_beginthread() instead of CreateThread()?
things like that -- if given the proper handle.
So verify that you have correct handle, that you haven't corrupted CRT
somehow and try to put a breakpoint at the end of the routine and singlestep
into the CRT to see where it stops.
- Sten
- How does KeWaitForMultipleObjects() handle multiple signaled objects? (Drivers) by h.wulff
- DVD and CD recorder all in one-exits? (Video & DVD) by Roy Tony
- DVD and CD recorder all in one - exits? (Desktops) by Roy Tony
- Problem in deleting the dynamic memory in a parent thread that is allocated from a child thread (Development Resources) by Manisha
- MsgWaitForMultipleObjects returns ok, but event was not signaled. (Development Resources) by Mario Semo

