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 #27549 is a reply to message #27540] Fri, 23 July 2010 04:28 Go to previous messageGo to previous message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i add delays into your code and the timer killing is asynchronous with timer callback execution. I regard this as a flaw. I can kill it, but I cannot know whether it is executed. I have to choose other implementations.
class MyWindow : public TopWindow
{
	typedef MyWindow CLASSNAME;
public:
	void Count()
	{ 
	//here 2nd.
	Sleep(10000);
	//here 5th.
	}
};
void MyThread(Callback cb)
{
	TimeCallback timer;
	timer.Set(1000, cb);
	//here 1st.
	Sleep(5000);
	//here 3rd.
	timer.Kill();
	//here 4th.
}
...
 
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: Sun Jul 06 20:00:13 CEST 2025

Total time taken to generate the page: 0.03381 seconds