summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentthreadengine.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-04-02 10:33:49 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2020-04-03 19:46:04 +0200
commit1812830ac3d5b167ddbb998cef58096d47da9989 (patch)
tree94faced57c9af4f74305b5f43b7fdfdfe5acab0f /src/concurrent/qtconcurrentthreadengine.h
parent6a6482cb8d2e71296e4c6ae35190a551fc4c6530 (diff)
Fix potential race condition in QtConcurrent blocking methods
QtConcurrent::blocking*() methods are using the ExceptionStore directly, which is not thread safe. In case if there's an exception thrown from multiple threads there may be a race condition. Added a lock to avoid that. Change-Id: I5de9928f91f5f43951b9bf9c4594694dc0ca0328 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/concurrent/qtconcurrentthreadengine.h')
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index af413707e49..b7be48d6125 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -121,6 +121,7 @@ protected:
QThreadPool *threadPool;
ThreadEngineBarrier barrier;
QtPrivate::ExceptionStore exceptionStore;
+ QBasicMutex mutex;
};