U++ framework
Do not panic. Ask here before giving up.

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: 14291
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: Sun Sep 20 09:23:32 GMT+2 2026

Total time taken to generate the page: 0.04006 seconds