Hey guys, does anyone have any experience with Waitable Timers cause I'm having a bit of bother with them.
I create one with (surprise surprise again) SetWaitableTimer and again everythings grand, I get back a none -ero value.
Now if I call WaitForSingleObject evrything works, the thread suspend for appropiate timeout and then continues, the problem is that I really want to not suspend the thread but just have the callback routine called after the timeout but it just never gets called.
I've read over msdn (heres the link for those interested) and I can't see why it shouldn't work. Am I using this thing out of the context it's ment to be used?
Thanks anyone if you can offer help, Eoin.
I create one with (surprise surprise again) SetWaitableTimer and again everythings grand, I get back a none -ero value.
Now if I call WaitForSingleObject evrything works, the thread suspend for appropiate timeout and then continues, the problem is that I really want to not suspend the thread but just have the callback routine called after the timeout but it just never gets called.
I've read over msdn (heres the link for those interested) and I can't see why it shouldn't work. Am I using this thing out of the context it's ment to be used?
Thanks anyone if you can offer help, Eoin.
[...]and the thread that set the timer calls the completion routine when it enters an alertable wait state.
That's how Async Procedure Calls are done... so I'm afraid you'll have to Sleep() (or do another action that puts you in a wait state).
Create a separate thread that waits and then triggers the callback?
Otherwise like f0dder said you'll have to Sleep(). I think SleepEx() with bAlertable = TRUE will do this.
Otherwise like f0dder said you'll have to Sleep(). I think SleepEx() with bAlertable = TRUE will do this.
Thanks guys, its a pity but I can think of a work around for my particular prob. Cheers.