summaryrefslogtreecommitdiffstats
path: root/src/concurrent
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2021-06-10 17:38:27 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2021-07-08 10:12:35 +0200
commit4d6752e8d2ed9d303befe7adf7f6e4b6ba16bbb9 (patch)
tree329526a872dd9e801a95a2c256ed4d1cb5f7a25b /src/concurrent
parent2a3425cb49eff0753feae3b41bc36655e30b0372 (diff)
Remove the dead code for blocking methods from QtConcurrent
After 79fd1cb2c631b6084bf10874205d27f5b53c907a the methods for running QtConcurrent algorithms in the blocking mode aren't used anymore. Since ThreadEngineBase and ThreadEngineStarter classes aren't meant to be used externally, it should be fine to remove startBlocking() methods now. Removed the unused code and adjusted the tests accordingly. Change-Id: Ifb13820ce207869d6f720bcb5be8d35bb355fe33 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 1bf75f2a661c05c7f1126187310d7df3f9704af5)
Diffstat (limited to 'src/concurrent')
-rw-r--r--src/concurrent/qtconcurrentthreadengine.cpp33
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h23
2 files changed, 0 insertions, 56 deletions
diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp
index 4679bd7e5c..e533ae9f9e 100644
--- a/src/concurrent/qtconcurrentthreadengine.cpp
+++ b/src/concurrent/qtconcurrentthreadengine.cpp
@@ -176,39 +176,6 @@ 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();
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index 6176221961..1baf8e5b19 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -91,7 +91,6 @@ public:
ThreadEngineBase();
virtual ~ThreadEngineBase();
void startSingleThreaded();
- void startBlocking();
void startThread();
bool isCanceled();
void waitForResume();
@@ -145,15 +144,6 @@ public:
}
// Runs the user algorithm using multiple threads.
- // This function blocks until the algorithm is finished,
- // and then returns the result.
- T *startBlocking()
- {
- ThreadEngineBase::startBlocking();
- return result();
- }
-
- // Runs the user algorithm using multiple threads.
// Does not block, returns a future.
QFuture<T> startAsynchronously()
{
@@ -233,13 +223,6 @@ class ThreadEngineStarter : public ThreadEngineStarterBase<T>
public:
ThreadEngineStarter(TypedThreadEngine *eng)
: Base(eng) { }
-
- T startBlocking()
- {
- T t = *this->threadEngine->startBlocking();
- delete this->threadEngine;
- return t;
- }
};
// Full template specialization where T is void.
@@ -249,12 +232,6 @@ class ThreadEngineStarter<void> : public ThreadEngineStarterBase<void>
public:
ThreadEngineStarter(ThreadEngine<void> *_threadEngine)
: ThreadEngineStarterBase<void>(_threadEngine) {}
-
- void startBlocking()
- {
- this->threadEngine->startBlocking();
- delete this->threadEngine;
- }
};
//! [qtconcurrentthreadengine-1]