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++ MT-multithreading and servers » Stop Download
Re: Stop Download [message #27439 is a reply to message #27406] Sat, 17 July 2010 23:03 Go to previous message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Ok, I found an fast solution:

1) Using an hidden progress that take in account the "tarminate" flag:
class MyHideProgress {
protected:
	int                 	total, pos;
	volatile Atomic     	*terminated;

public:
	bool     SetCanceled(int p, int t)     { pos = p; total = t; return (bool)*terminated; }

	operator Gate2<int, int>()             { return callback(this, &MyHideProgress::SetCanceled); }

  typedef MyProgress CLASSNAME;

	MyHideProgress(volatile Atomic *t)		 { terminated = t; }
};


2) In this way the gui program can be closed quickly also with HttpClient working in background thread.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Socket and multiple Threads
Next Topic: PROPOSAL: Monitor mutex in objects
Goto Forum:
  


Current Time: Sun May 05 15:27:19 CEST 2024

Total time taken to generate the page: 0.02217 seconds