Reputation: 14264
My console application calls WaitForSingleObject
in the parent thread with a timeout value of 5 seconds.
dwObjectWaitState = ::WaitForSingleObject( s_hRxDataEvent, 50000L );
After configuring the physical environment (i.e. no code changes), so that the event will never get signaled, I set a breakpoint at the following line, and run the application. The PC never gets to the breakpoint. s_hRxDataEvent
is a valid event handle that is normally set in a child thread. The application works great when the physical environment is configured as expected. Why doesn't the function time out? Thanks.
Upvotes: 0
Views: 788
Reputation: 109279
The timeout value for WaitForSingleObject
is specified in milliseconds, so 50000L means 50 seconds, not 5 seconds.
Upvotes: 1
Reputation: 70731
The timeout is in milliseconds. 50000 is 50 seconds, not 5 seconds.
Upvotes: 2