|
-
January 10th, 2009, 10:17 AM
#3
Re: DLL EntryPoint - Problem
Hello,
DLL_THREAD_DETACH is called when a thread is exiting in a clean manner. Do you have such a thread in your process you know it's doing this ?
DLL_THREAD_DETACH is not called when a thread is terminated.
I would suggest also to remove the Sleep(2000) line and move the 2000 timeout inside WaitForSingleObject() call, it's more efficient.
Also, after SetEvent(this->stopFlag), I would check that the thread has exited before closing the event handle. (for example with a WaitForSingleObject(this->threadHandle, sometimeout))
This is becouse the thread might be executing the Sleep(2000) while the event handle is closed, therefore WaitForSingleObject(this->stopFlag,0) would never return WAIT_OBJECT_0 and you'll never break the while() loop.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|