summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-08 08:40:49 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-12 14:12:45 (GMT)
commitb9ad76af13fc1d253845e027f91f22039bf14f9c (patch)
treec70d592a6bbbaae96e818e1de92e82e53390f393 /Swiften/EventLoop/Qt
parent4e6713df2d55dc1b2970d9c3b619d2a415e1264f (diff)
downloadswift-b9ad76af13fc1d253845e027f91f22039bf14f9c.zip
swift-b9ad76af13fc1d253845e027f91f22039bf14f9c.tar.bz2
Use C++11 threading library instead of Boost.Thread
This cuts down our dependency on Boost further. Another benefit is that mutex classes of C++11 standard library are recognized by TSAN. Test-Information: Unit and integration tests pass on OS X 10.11.4. Change-Id: Id4dcdb42e3d5155e107ce1d7618acbf26f913b6f
Diffstat (limited to 'Swiften/EventLoop/Qt')
-rw-r--r--Swiften/EventLoop/Qt/QtEventLoop.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/EventLoop/Qt/QtEventLoop.h b/Swiften/EventLoop/Qt/QtEventLoop.h
index 3f5e93c..b1644c2 100644
--- a/Swiften/EventLoop/Qt/QtEventLoop.h
+++ b/Swiften/EventLoop/Qt/QtEventLoop.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/thread.hpp>
+#include <mutex>
#include <QCoreApplication>
#include <QEvent>
@@ -24,7 +24,7 @@ namespace Swift {
protected:
virtual void eventPosted() {
- boost::recursive_mutex::scoped_lock lock(isEventInQtEventLoopMutex_);
+ std::unique_lock<std::recursive_mutex> lock(isEventInQtEventLoopMutex_);
if (!isEventInQtEventLoop_) {
isEventInQtEventLoop_ = true;
QCoreApplication::postEvent(this, new Event());
@@ -35,7 +35,7 @@ namespace Swift {
Event* event = dynamic_cast<Event*>(qevent);
if (event) {
{
- boost::recursive_mutex::scoped_lock lock(isEventInQtEventLoopMutex_);
+ std::unique_lock<std::recursive_mutex> lock(isEventInQtEventLoopMutex_);
isEventInQtEventLoop_ = false;
}
handleNextEvents();
@@ -54,6 +54,6 @@ namespace Swift {
};
bool isEventInQtEventLoop_;
- boost::recursive_mutex isEventInQtEventLoopMutex_;
+ std::recursive_mutex isEventInQtEventLoopMutex_;
};
}