diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-02 09:36:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-02-05 09:54:04 +0000 |
commit | 640202f5248de274b83356e963b0e1a2e405aa18 (patch) | |
tree | 3d4f04150ca1e6ea3d18eb411ac08d325956b10d /sc | |
parent | 1e2f6e7b27fafd6c579dfb09ccd2012151b4ab7e (diff) |
osl::Mutex->std::atomic in sc::ReaderThread
Change-Id: I10296bb29fc59475f0e3b13c06da97e703485792
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146556
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/datastream.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index edd3aeaf26cd..dad99bba0e30 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -28,6 +28,7 @@ #include <orcus/csv_parser.hpp> +#include <atomic> #include <queue> namespace com::sun::star::ui { class XUIElement; } @@ -96,8 +97,7 @@ class ReaderThread : public salhelper::Thread { std::unique_ptr<SvStream> mpStream; size_t mnColCount; - bool mbTerminate; - osl::Mutex maMtxTerminate; + std::atomic<bool> mbTerminate; std::queue<std::unique_ptr<DataStream::LinesType>> maPendingLines; std::queue<std::unique_ptr<DataStream::LinesType>> maUsedLines; @@ -122,14 +122,12 @@ public: bool isTerminateRequested() { - osl::MutexGuard aGuard(maMtxTerminate); - return mbTerminate; + return mbTerminate.load(); } void requestTerminate() { - osl::MutexGuard aGuard(maMtxTerminate); - mbTerminate = true; + mbTerminate.store(true); } void endThread() |