1
0
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:
nds
2018-06-07 15:59:03 +03:00
committed by bugmaster
parent bc37935836
commit 0c44027cb9
3 changed files with 26 additions and 1 deletions

View File

@@ -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();
}
}