diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-03-04 10:30:44 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-03-05 17:35:14 -0500 |
commit | 59a9a04651486763b49ddb706a195bebccf76642 (patch) | |
tree | 335fa6d0cbc04f2c3577d2e4594e9a573f2b4594 /src/mongo/shell/bench.cpp | |
parent | ac525a4566a46b6b79a8465903b2ab0391eab506 (diff) | |
download | mongo-59a9a04651486763b49ddb706a195bebccf76642.tar.gz |
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.
Diffstat (limited to 'src/mongo/shell/bench.cpp')
-rw-r--r-- | src/mongo/shell/bench.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp index 069af0ee7c7..9af842f3e6e 100644 --- a/src/mongo/shell/bench.cpp +++ b/src/mongo/shell/bench.cpp @@ -241,7 +241,7 @@ namespace mongo { } void BenchRunState::waitForState(State awaitedState) { - boost::mutex::scoped_lock lk(_mutex); + boost::lock_guard<boost::mutex> lk(_mutex); switch ( awaitedState ) { case BRS_RUNNING: @@ -265,7 +265,7 @@ namespace mongo { } void BenchRunState::assertFinished() { - boost::mutex::scoped_lock lk(_mutex); + boost::lock_guard<boost::mutex> lk(_mutex); verify(0 == _numUnstartedWorkers + _numActiveWorkers); } @@ -274,7 +274,7 @@ namespace mongo { } void BenchRunState::onWorkerStarted() { - boost::mutex::scoped_lock lk(_mutex); + boost::lock_guard<boost::mutex> lk(_mutex); verify( _numUnstartedWorkers > 0 ); --_numUnstartedWorkers; ++_numActiveWorkers; @@ -284,7 +284,7 @@ namespace mongo { } void BenchRunState::onWorkerFinished() { - boost::mutex::scoped_lock lk(_mutex); + boost::lock_guard<boost::mutex> lk(_mutex); verify( _numActiveWorkers > 0 ); --_numActiveWorkers; if (_numActiveWorkers + _numUnstartedWorkers == 0) { @@ -761,7 +761,7 @@ namespace mongo { _config(config) { _oid.init(); - boost::mutex::scoped_lock lk(_staticMutex); + boost::lock_guard<boost::mutex> lk(_staticMutex); _activeRuns[_oid] = this; } @@ -825,7 +825,7 @@ namespace mongo { } { - boost::mutex::scoped_lock lk(_staticMutex); + boost::lock_guard<boost::mutex> lk(_staticMutex); _activeRuns.erase( _oid ); } } @@ -836,7 +836,7 @@ namespace mongo { } BenchRunner* BenchRunner::get( OID oid ) { - boost::mutex::scoped_lock lk(_staticMutex); + boost::lock_guard<boost::mutex> lk(_staticMutex); return _activeRuns[ oid ]; } |