Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
bonami is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Time callbacks when ticks overlap
Next Topic: Callbacks with 'Disable' feature
Goto Forum:
  


Current Time: Wed Aug 27 21:17:34 CEST 2025

Total time taken to generate the page: 0.06400 seconds