teubenragee
Programmer
Here is a little code:
HANDLE hThread;
...
hThread=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ThreadFunc,(LPVOID) Param,0,ThreadID);
...
void ThreadFunc(LPVOID Param)
HANDLE hEvent;
hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
ResetEvent(hEvent);
WaitForSingleObject(hEvent,INFINITE);
...
I never Set the hEvent object
and the thread is really running(I've checked this)
I checked the hEvent value : it is not INVALID_HANDLE_VALUE
I check the result of the Waiting function: it is WAIT_OBJECT_0
The thread goes through the wait function as if the Event was always set
Why?
HANDLE hThread;
...
hThread=CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ThreadFunc,(LPVOID) Param,0,ThreadID);
...
void ThreadFunc(LPVOID Param)
HANDLE hEvent;
hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
ResetEvent(hEvent);
WaitForSingleObject(hEvent,INFINITE);
...
I never Set the hEvent object
and the thread is really running(I've checked this)
I checked the hEvent value : it is not INVALID_HANDLE_VALUE
I check the result of the Waiting function: it is WAIT_OBJECT_0
The thread goes through the wait function as if the Event was always set
Why?