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 » MT app hangs
Re: MT app hangs [message #24024 is a reply to message #24022] Thu, 17 December 2009 21:15 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well... now I'm running out of ideas !
Why this

// calculation thread function
void CalcPage::DoCalculation(void)
{
	// gets the status bar
	StatusBar &sb = ((Lamell *)(GetMainWindow()))->GetStatusBar();
	{
		GuiLock __;
		sb.Set("Calcolo in corso");
	}
	calcAborted = !Calculate();
	{
		GuiLock __;
		if(calcAborted)
			sb.Set("Errore");
		else
			sb.Set("Pronto");
	}
}

// modify handler -- triggers page calculation
// (triggered by button)
void CalcPage::ModifyCb(void)
{
	PostCallback(THISBACK(CalcAgainCb));
}

// callback in case modify handler is re-entered when
// calc thread still working
void CalcPage::CalcAgainCb(void)
{
	if(!calcThread.IsOpen())
		// restarts the calculation if thread not already working
		calcThread.Run(THISBACK(DoCalculation));
		// otherwise repost calculation for later
	else
		PostCallback(THISBACK(CalcAgainCb));
}


doesn't work ???
It just runs calc thread once, so I guess IsOpen() always returns true.... so, thread still blocked somewhere.

Ciao

Max
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MT.cpp __thread sMain related CRASH in VB6 project
Next Topic: Socket through Proxy server
Goto Forum:
  


Current Time: Wed May 08 23:15:24 CEST 2024

Total time taken to generate the page: 0.02323 seconds