summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/BoostTimer.cpp')
-rw-r--r--Swiften/Network/BoostTimer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/BoostTimer.cpp b/Swiften/Network/BoostTimer.cpp
index 846192c..a177504 100644
--- a/Swiften/Network/BoostTimer.cpp
+++ b/Swiften/Network/BoostTimer.cpp
@@ -21,14 +21,14 @@ BoostTimer::BoostTimer(int milliseconds, std::shared_ptr<boost::asio::io_service
BoostTimer::~BoostTimer() {
{
- boost::mutex::scoped_lock lockTimer(timerMutex);
+ std::unique_lock<std::mutex> lockTimer(timerMutex);
timer.reset();
}
}
void BoostTimer::start() {
{
- boost::mutex::scoped_lock lockTimer(timerMutex);
+ std::unique_lock<std::mutex> lockTimer(timerMutex);
shuttingDown = false;
timer->expires_from_now(boost::posix_time::milliseconds(timeout));
timer->async_wait(boost::bind(&BoostTimer::handleTimerTick, shared_from_this(), boost::asio::placeholders::error));
@@ -37,7 +37,7 @@ void BoostTimer::start() {
void BoostTimer::stop() {
{
- boost::mutex::scoped_lock lockTimer(timerMutex);
+ std::unique_lock<std::mutex> lockTimer(timerMutex);
shuttingDown = true;
timer->cancel();
eventLoop->removeEventsFromOwner(shared_from_this());
@@ -50,7 +50,7 @@ void BoostTimer::handleTimerTick(const boost::system::error_code& error) {
}
else {
{
- boost::mutex::scoped_lock lockTimer(timerMutex);
+ std::unique_lock<std::mutex> lockTimer(timerMutex);
if (shuttingDown) {
return;
}