summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/bench.cpp14
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp20
2 files changed, 17 insertions, 17 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 ];
}
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index 96f3c7bbdd3..48ff2dd3c36 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -92,18 +92,18 @@ namespace mongo {
ProgramOutputMultiplexer programOutputLogger;
bool ProgramRegistry::isPortRegistered( int port ) const {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
return _ports.count( port ) == 1;
}
ProcessId ProgramRegistry::pidForPort( int port ) const {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
verify( isPortRegistered( port ) );
return _ports.find( port )->second.first;
}
int ProgramRegistry::portForPid(ProcessId pid) const {
- boost::recursive_mutex::scoped_lock lk(_mutex);
+ boost::lock_guard<boost::recursive_mutex> lk(_mutex);
for (map<int, pair<ProcessId, int> >::const_iterator it = _ports.begin();
it != _ports.end(); ++it)
{
@@ -114,13 +114,13 @@ namespace mongo {
}
void ProgramRegistry::registerPort( int port, ProcessId pid, int output ) {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
verify( !isPortRegistered( port ) );
_ports.insert( make_pair( port, make_pair( pid, output ) ) );
}
void ProgramRegistry::deletePort( int port ) {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
if ( !isPortRegistered( port ) ) {
return;
}
@@ -129,7 +129,7 @@ namespace mongo {
}
void ProgramRegistry::getRegisteredPorts( vector<int> &ports ) {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
for( map<int,pair<ProcessId,int> >::const_iterator i = _ports.begin(); i != _ports.end();
++i ) {
ports.push_back( i->first );
@@ -137,18 +137,18 @@ namespace mongo {
}
bool ProgramRegistry::isPidRegistered( ProcessId pid ) const {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
return _pids.count( pid ) == 1;
}
void ProgramRegistry::registerPid( ProcessId pid, int output ) {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
verify( !isPidRegistered( pid ) );
_pids.insert( make_pair( pid, output ) );
}
void ProgramRegistry::deletePid(ProcessId pid) {
- boost::recursive_mutex::scoped_lock lk(_mutex);
+ boost::lock_guard<boost::recursive_mutex> lk(_mutex);
if (!isPidRegistered(pid)) {
int port = portForPid(pid);
if (port < 0) return;
@@ -160,7 +160,7 @@ namespace mongo {
}
void ProgramRegistry::getRegisteredPids( vector<ProcessId> &pids ) {
- boost::recursive_mutex::scoped_lock lk( _mutex );
+ boost::lock_guard<boost::recursive_mutex> lk( _mutex );
for( map<ProcessId,int>::const_iterator i = _pids.begin(); i != _pids.end(); ++i ) {
pids.push_back( i->first );
}