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"); } }
Report message to a moderator