Home » U++ Library support » U++ Callbacks and Timers » how to use timer id? and how to kill a timer
Re: how to use timer id? [message #27536 is a reply to message #27533] |
Thu, 22 July 2010 11:32   |
 |
bonami
Messages: 186 Registered: June 2007 Location: Beijing
|
Experienced Member |
|
|
I need the timer creation and killing to be executed in main thread.
When I kill the timer, there are two situations.
One, the callback has already been executing. Then I cannot tell in the callback whether it should execute. This is why I need the killing operation to be executed in main thread.
Two, the timer has not timed out yet. This way, the callback will never be executed. This is all right.
My real implementation is an auto processor.
A timer can be asked for. Before it ends, network packets may ends it. Thread is blocked by a semaphore. Network packets minus this semaphore. Timer ending minus it, too. If network packets received, the timer needs to be killed. And later packets needs to be neglected. After a while, this all may run again. So the timer callback cannot be executed again after I called timer killing. Otherwise, it will mess up the next round.
[Updated on: Thu, 22 July 2010 11:49] Report message to a moderator
|
|
|
 |
|
how to use timer id? and how to kill a timer
By: bonami on Tue, 20 July 2010 10:03
|
 |
|
Re: how to use timer id?
By: mrjt on Wed, 21 July 2010 10:46
|
 |
|
Re: how to use timer id?
By: bonami on Wed, 21 July 2010 11:28
|
 |
|
Re: how to use timer id?
By: mrjt on Wed, 21 July 2010 12:54
|
 |
|
Re: how to use timer id?
By: bonami on Thu, 22 July 2010 04:09
|
 |
|
Re: how to use timer id?
By: mrjt on Thu, 22 July 2010 10:58
|
 |
|
Re: how to use timer id?
By: bonami on Thu, 22 July 2010 11:32
|
 |
|
Re: how to use timer id?
By: mrjt on Thu, 22 July 2010 12:10
|
 |
|
Re: how to use timer id?
By: bonami on Fri, 23 July 2010 04:28
|
 |
|
Re: how to use timer id?
By: mrjt on Fri, 23 July 2010 11:32
|
 |
|
Re: how to use timer id?
By: bonami on Mon, 26 July 2010 04:16
|
Goto Forum:
Current Time: Wed Aug 27 21:17:34 CEST 2025
Total time taken to generate the page: 0.06400 seconds
|