aitForSingleObject exit for timeout only, thread is not signaled
Hello everybody,
I am working with a thread for implementing a timer. If the thread is started / exited directly from an application (standard exe) everything works fine, but if I create and exit it from within a DLL loaded by the application, WaitForSingleObject fails to detect the thread exit. Why is that?
WaitForSingleObject exits with WAIT_TIMEOUT after 5 seconds instead of WAIT_OBJECT_0 (the one that I expect) and then I am forced to kill the thread with
TerminateThread.
I used the scroll key LED and Dbgview (OutputDebugString) for debugging.
In case someone were so kind to help me I attached a sample Borland C++ Builder project with the code below (including a testing console for loading / unloading the DLL library).
Anyone can help?
Thank you very much in advance!!!!!!
Bookmarks