diff options
Diffstat (limited to 'src/concurrent/qtconcurrentthreadengine.cpp')
-rw-r--r-- | src/concurrent/qtconcurrentthreadengine.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp index ea6ce3ac42..7f91a2ba68 100644 --- a/src/concurrent/qtconcurrentthreadengine.cpp +++ b/src/concurrent/qtconcurrentthreadengine.cpp @@ -176,6 +176,39 @@ void ThreadEngineBase::startSingleThreaded() finish(); } +void ThreadEngineBase::startBlocking() +{ + start(); + barrier.acquire(); + startThreads(); + + bool throttled = false; +#ifndef QT_NO_EXCEPTIONS + try { +#endif + while (threadFunction() == ThrottleThread) { + if (threadThrottleExit()) { + throttled = true; + break; + } + } +#ifndef QT_NO_EXCEPTIONS + } catch (QException &e) { + handleException(e); + } catch (...) { + handleException(QUnhandledException()); + } +#endif + + if (throttled == false) { + barrier.release(); + } + + barrier.wait(); + finish(); + exceptionStore.throwPossibleException(); +} + void ThreadEngineBase::startThread() { startThreadInternal(); |