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 » Thread calls GUI
Re: Thread calls GUI [message #20102 is a reply to message #20099] Tue, 17 February 2009 19:18 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
tojocky wrote on Tue, 17 February 2009 09:57

How about to add semaphore method dword Semaphore::Wait(int timeout)?

in win32 is simple:
int Semaphore::Wait( int timeout )
{
	dword result_value;
	result_value = WaitForSingleObject(handle, timeout);
	if(result_value == WAIT_FAILED) return(SEMAPHORE_WAIT_ERROR);
	if(result_value == WAIT_TIMEOUT) return(SEMAPHORE_TIMEOUT);
}


but in POSIX is more hardly.
The good article found here.

I think it have sense on i have a postcallback and i know maximum execution time. Or I'm wrong?


I do not know. I believe all these timeouts just make it more error-prone. You generally should not depend on timeout when dealing with semaphore (IMO!).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StaticMutex/ONCELOCK question
Next Topic: GUI MT project does not compile
Goto Forum:
  


Current Time: Sat Apr 20 11:26:17 CEST 2024

Total time taken to generate the page: 0.06771 seconds