aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-04-19 11:50:35 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-05-04 06:02:14 +0000
commit9db37be7210d4071c8b2c7bfa98d1822075ab452 (patch)
tree6d4b7e0152cf60c347c4387de47a9edf181ee006
parentb67458583c3cd38b48d8d00a88c9e236ca64b368 (diff)
Allow for separate threads accessing the abort variable at the same time
This fixes a problem reported by Intel Inspector 2016 which indicated that multiple threads could access the abort variable at the same time. So by making it atomic we avoid any problems in this regard. Task-number: QTBUG-60037 Change-Id: I79d293916f5105e8a36c41d3bc89cd1cb93e5109 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/virtualkeyboard/hunspellworker.h2
-rw-r--r--src/virtualkeyboard/lipiworker.h2
-rw-r--r--src/virtualkeyboard/t9writeworker.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/virtualkeyboard/hunspellworker.h b/src/virtualkeyboard/hunspellworker.h
index 71025b91..43fb07e4 100644
--- a/src/virtualkeyboard/hunspellworker.h
+++ b/src/virtualkeyboard/hunspellworker.h
@@ -147,7 +147,7 @@ private:
QSemaphore taskSema;
QMutex taskLock;
Hunhandle *hunspell;
- bool abort;
+ QAtomicInteger<bool> abort;
};
} // namespace QtVirtualKeyboard
diff --git a/src/virtualkeyboard/lipiworker.h b/src/virtualkeyboard/lipiworker.h
index 3f84ec9f..676a2341 100644
--- a/src/virtualkeyboard/lipiworker.h
+++ b/src/virtualkeyboard/lipiworker.h
@@ -140,7 +140,7 @@ private:
QSemaphore taskSema;
QMutex taskLock;
LTKShapeRecognizer *shapeRecognizer;
- bool abort;
+ QAtomicInteger<bool> abort;
};
} // namespace QtVirtualKeyboard
diff --git a/src/virtualkeyboard/t9writeworker.h b/src/virtualkeyboard/t9writeworker.h
index 9a6994ae..23a4cf02 100644
--- a/src/virtualkeyboard/t9writeworker.h
+++ b/src/virtualkeyboard/t9writeworker.h
@@ -175,7 +175,7 @@ private:
QSemaphore taskSema;
QMutex taskLock;
DECUMA_SESSION *decumaSession;
- bool abort;
+ QAtomicInteger<bool> abort;
};
} // namespace QtVirtualKeyboard