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 #24011 is a reply to message #23995] Thu, 17 December 2009 13:22 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
void TestThread::thrCb(void)
{
	{
		GuiLock __;
		status.Set("Running, " + FormatInt(thr.GetCount()) + " threads");
	}
	for(;;)
	{
		{
			GuiLock __;
			if(progress < 100)
				progress++;
			else
				progress = 0;
		}
		Sleep(100);
		if(stop)
			break;
	}
}

void TestThread::buttonCb(void)
{
	if(stop)
	{
		stop = false;
		button.SetLabel("STOP");
		thr.Run(THISBACK(thrCb));
	}
	else
	{
		stop = true;
		thr.Wait();
		status.Set("Idle....");
		button.SetLabel("START");
	}
	
}


The problem was that GuiLock is locked in buttonCb (that is the point...).

Mirek
 
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: Thu May 09 01:10:55 CEST 2024

Total time taken to generate the page: 0.02893 seconds