Reputation: 7447
Does WaitForSingleObject()
with timeout = 0 ms result in thread context switch immediately and the thread to loose its remaining timeslice?
Upvotes: 1
Views: 3126
Reputation: 347196
If the handle is signaled it does not enter a waite state ever. And if the dwMilliseconds parameter is 0 it will not enter the wait state even if it is not signaled.
Regarding its second param: dwMilliseconds MSDN says the following:
... if dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately...
Upvotes: 3
Reputation: 28050
The documentation says otherwise. MSDN: WatiForSingleObject:
If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately.
Upvotes: 4