
Anthony Williams wrote:
Alexander Terekhov <terekhov <at> web.de> writes:
Anthony Williams wrote: [...]
Waitable timers. According to the docs, when you specify an absolute timeout for a timer it tracks clock changes.
That isn't really helpful given that win32 waitable timers don't synchronize with condvar waiters by locking associated mutexes.
The point is that a condvar waiter doing a timed wait can use the waitable timer as part of a WaitForMultipleObjects call waiting on the sync objects internal to the cond var, rather than using a timeout: if the waitable timer is triggered then the specified absolute time has been reached, and the call has timed out.
Of course, the condvar implementation then needs to handle relocking the mutexes.
I meant the race between clock change and "WaitForMultipleObjects call waiting". regards, alexander.