From: Nicolas Boichat Date: Fri, 30 Apr 2004 16:02:02 +0000 (+0000) Subject: - wxbRestorePanel : Fixed 100% CPU usage in GTK : added sleeps between Yields. X-Git-Tag: Release-1.34.3~69 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a6f7d46c076d44c2a4bad4ec55db85a1642a5677;p=bacula%2Fbacula - wxbRestorePanel : Fixed 100% CPU usage in GTK : added sleeps between Yields. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1331 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 3a571ef953..e221c966cb 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -614,10 +614,11 @@ void wxbRestorePanel::CmdStart() { << "-" << willdo << "]", CS_DEBUG);*/ } wxTheApp->Yield(true); + ::wxUsleep(100); } gauge->SetValue(tot); - wxTheApp->Yield(); + wxTheApp->Yield(true); gauge->SetValue(0); delete dt; @@ -739,7 +740,8 @@ void wxbRestorePanel::CmdStart() { time_t start = wxDateTime::Now().GetTicks(); while (((wxDateTime::Now().GetTicks())-start) < 10) { - wxTheApp->Yield(); + wxTheApp->Yield(true); + ::wxUsleep(100); } } @@ -1039,7 +1041,8 @@ wxbTableParser* wxbRestorePanel::CreateAndWaitForParser(wxString cmd) { //time_t base = wxDateTime::Now().GetTicks(); while (!tableParser->hasFinished()) { //innerThread->Yield(); - wxTheApp->Yield(); + wxTheApp->Yield(true); + ::wxUsleep(100); //if (base+15 < wxDateTime::Now().GetTicks()) break; } return tableParser; @@ -1056,7 +1059,8 @@ wxbPromptParser* wxbRestorePanel::WaitForPrompt(wxString cmd, bool keepresults) //time_t base = wxDateTime::Now().GetTicks(); while (!promptParser->hasFinished()) { //innerThread->Yield(); - wxTheApp->Yield(); + wxTheApp->Yield(true); + ::wxUsleep(100); //if (base+15 < wxDateTime::Now().GetTicks()) break; } @@ -1080,7 +1084,8 @@ wxbDataTokenizer* wxbRestorePanel::WaitForEnd(wxString cmd, bool keepresults, bo //time_t base = wxDateTime::Now().GetTicks(); while (!datatokenizer->hasFinished()) { //innerThread->Yield(); - wxTheApp->Yield(); + wxTheApp->Yield(true); + ::wxUsleep(100); //if (base+15 < wxDateTime::Now().GetTicks()) break; }