summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/datastream.cxx10
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()