From 59a9a04651486763b49ddb706a195bebccf76642 Mon Sep 17 00:00:00 2001 From: Andy Schwerin Date: Wed, 4 Mar 2015 10:30:44 -0500 Subject: SERVER-17310 Replace boost::*_mutex::scoped_lock with boost::lock_guard. Achieved via grep, sed and bash: grep -Irl mutex::scoped_lock src/mongo | xargs sed -i.orig -E 's/(boost::(recursive_|timed_)?)mutex::scoped_lock/boost::lock_guard<\1mutex>/' Then, by converting boost::lock_guard to boost::unique_lock as appropriate. Finally, by removing unused mongo::mutex::try_lock. --- src/mongo/scripting/v8-3.25_utils.cpp | 4 ++-- src/mongo/scripting/v8_utils.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mongo/scripting') diff --git a/src/mongo/scripting/v8-3.25_utils.cpp b/src/mongo/scripting/v8-3.25_utils.cpp index 566f1b3b879..8daa4f4dacd 100644 --- a/src/mongo/scripting/v8-3.25_utils.cpp +++ b/src/mongo/scripting/v8-3.25_utils.cpp @@ -162,11 +162,11 @@ namespace mongo { BSONObj _args; BSONObj _returnData; void setErrored(bool value) { - boost::mutex::scoped_lock lck(_erroredMutex); + boost::lock_guard lck(_erroredMutex); _errored = value; } bool getErrored() { - boost::mutex::scoped_lock lck(_erroredMutex); + boost::lock_guard lck(_erroredMutex); return _errored; } private: diff --git a/src/mongo/scripting/v8_utils.cpp b/src/mongo/scripting/v8_utils.cpp index 098d04e8123..a540666c61e 100644 --- a/src/mongo/scripting/v8_utils.cpp +++ b/src/mongo/scripting/v8_utils.cpp @@ -161,11 +161,11 @@ namespace mongo { BSONObj _args; BSONObj _returnData; void setErrored(bool value) { - boost::mutex::scoped_lock lck(_erroredMutex); + boost::lock_guard lck(_erroredMutex); _errored = value; } bool getErrored() { - boost::mutex::scoped_lock lck(_erroredMutex); + boost::lock_guard lck(_erroredMutex); return _errored; } private: -- cgit v1.2.1