mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +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:
parent
bc37935836
commit
0c44027cb9
12
tests/tools/dfbrowser/A9
Normal file
12
tests/tools/dfbrowser/A9
Normal file
@ -0,0 +1,12 @@
|
||||
puts "========"
|
||||
puts "0029841: Test cases from tools/dfbrowser periodically hang on Windows platform"
|
||||
puts "========"
|
||||
|
||||
pload INSPECTOR
|
||||
|
||||
tinspector -plugins dfbrowser
|
||||
|
||||
for { set i 1 } { ${i} <= 10 } { incr i } {
|
||||
tinspector -open [locate_data_file bug29743.cbf] -select 0 TNaming_UsedShapes
|
||||
tinspector -open [locate_data_file bug29733.cbf] -select 0 TNaming_UsedShapes
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ private:
|
||||
QList<QThread*> myStartedThreads; //!< container of started threads
|
||||
DFBrowser_ThreadItem* myPostponedItem; //!< currently processed item in onFinished()
|
||||
bool myIsFinishProcessing; //!< blocking state if onFinished() is started but has not been finished yet
|
||||
Standard_Boolean myIsProcessPostponed; //!< state if process application should be done by finish active thread
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user