summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-02-25 09:10:19 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-02-29 15:41:50 (GMT)
commitc2b80af83f9ac19fefc21493c5a21ca232662ee2 (patch)
treef29a7a89a18b3129534d090c55a97d7f28fe3bcc /Swiften/Network/BoostConnection.h
parent14ddf8b470f5a3420b5f2c96daea33c2513cac6e (diff)
downloadswift-c2b80af83f9ac19fefc21493c5a21ca232662ee2.zip
swift-c2b80af83f9ac19fefc21493c5a21ca232662ee2.tar.bz2
Fix data race in BoostConnection reported by TSANswift-4.0alpha
ThreadSanitizer reported a data-race between Boost's socket close() and async_read_some(). Test-Information: Verified all tests still pass and that TSAN does not report an error anymore in a scenario where a Client connects/dis- connects randomly. Tested on Debian 8 and OS X 10.11.3. Change-Id: I5e705efb15bee767dd5a55539854b5e488b3bf64
Diffstat (limited to 'Swiften/Network/BoostConnection.h')
-rw-r--r--Swiften/Network/BoostConnection.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Swiften/Network/BoostConnection.h b/Swiften/Network/BoostConnection.h
index f933cd8..be44d51 100644
--- a/Swiften/Network/BoostConnection.h
+++ b/Swiften/Network/BoostConnection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -76,5 +76,6 @@ namespace Swift {
bool writing_;
SafeByteArray writeQueue_;
bool closeSocketAfterNextWrite_;
+ boost::mutex readCloseMutex_;
};
}