summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-02-06 17:30:45 (GMT)
committerSwift Review <review@swift.im>2015-02-08 12:04:41 (GMT)
commit2b81680fc59dd3170635967948727b4dc49b951e (patch)
treece289dfac86c6116ac2031ecec179b7d723ac022 /Swiften
parent19656914a7f9007c9e54588939c85752e509376c (diff)
downloadswift-2b81680fc59dd3170635967948727b4dc49b951e.zip
swift-2b81680fc59dd3170635967948727b4dc49b951e.tar.bz2
Fix data race in PlatformNATTraversalWorker reported by TSAN
Test-Information: Run on ClientTest as TSAN enabled build on Linux. Without the patch it reports a data race for the stopRequested member. Change-Id: I98373966c45d4c6e247f69fa8850278d885556f7
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Network/PlatformNATTraversalWorker.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Swiften/Network/PlatformNATTraversalWorker.h b/Swiften/Network/PlatformNATTraversalWorker.h
index 91b83f8..e9af651 100644
--- a/Swiften/Network/PlatformNATTraversalWorker.h
+++ b/Swiften/Network/PlatformNATTraversalWorker.h
@@ -14,6 +14,7 @@
#include <boost/logic/tribool.hpp>
#include <Swiften/Base/API.h>
+#include <Swiften/Base/Atomic.h>
#include <Swiften/Network/NATTraverser.h>
#include <Swiften/Network/HostAddressPort.h>
#include <Swiften/Network/NullNATTraversalInterface.h>
@@ -52,7 +53,7 @@ namespace Swift {
private:
EventLoop* eventLoop;
- bool stopRequested;
+ Atomic<bool> stopRequested;
boost::thread* thread;
std::deque<boost::shared_ptr<PlatformNATTraversalRequest> > queue;
boost::mutex queueMutex;