mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0029841: Test cases from tools/dfbrowser periodically hang on Windows platform
Do not start new thread if the thread has been already started. Restart the thread after the previous has finished.
This commit is contained in:
@@ -62,7 +62,8 @@ private:
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowser_Thread::DFBrowser_Thread (DFBrowser_Window* theWindow)
|
||||
: QObject (theWindow), myPostponedItem (0), myIsFinishProcessing (false)
|
||||
: QObject (theWindow), myPostponedItem (0), myIsFinishProcessing (false),
|
||||
myIsProcessPostponed (Standard_False)
|
||||
{
|
||||
DFBrowser_SearchLine* aSearchLine = theWindow->GetTreeLevelLine()->GetSearchLine();
|
||||
myItems.append (new DFBrowser_ThreadItemSearch(aSearchLine));
|
||||
@@ -74,6 +75,11 @@ DFBrowser_Thread::DFBrowser_Thread (DFBrowser_Window* theWindow)
|
||||
// =======================================================================
|
||||
void DFBrowser_Thread::ProcessApplication()
|
||||
{
|
||||
if (!myStartedThreads.empty())
|
||||
{
|
||||
myIsProcessPostponed = Standard_True;
|
||||
return;
|
||||
}
|
||||
for (int anItemId = 0, aSize = myItems.size(); anItemId < aSize; anItemId++)
|
||||
startThread (myItems[anItemId]);
|
||||
}
|
||||
@@ -135,4 +141,10 @@ void DFBrowser_Thread::onFinished()
|
||||
myPostponedItem->ApplyValues();
|
||||
myPostponedItem = 0;
|
||||
}
|
||||
|
||||
if (myIsProcessPostponed)
|
||||
{
|
||||
myIsProcessPostponed = Standard_False;
|
||||
ProcessApplication();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user