summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-06-17 18:50:18 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-06-18 12:23:32 -0400
commitc9c29cb2c7c0a1f6e79ea724e2ba91b3b1548983 (patch)
treed0615a4867789988cb5e984da5863d1a2963f243 /src/mongo
parent27042c685ee46baf0066186fca1d46b34ac2b440 (diff)
downloadmongo-c9c29cb2c7c0a1f6e79ea724e2ba91b3b1548983.tar.gz
SERVER-18723 boost -> stdx for recursive_mutex
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp30
-rw-r--r--src/mongo/shell/shell_utils_launcher.h2
-rw-r--r--src/mongo/stdx/mutex.h2
-rw-r--r--src/mongo/util/net/ssl_manager.cpp6
4 files changed, 20 insertions, 20 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index 618b08b3de1..ec36051859c 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -90,18 +90,18 @@ namespace mongo {
ProgramOutputMultiplexer programOutputLogger;
bool ProgramRegistry::isPortRegistered( int port ) const {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
return _ports.count( port ) == 1;
}
ProcessId ProgramRegistry::pidForPort( int port ) const {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
verify( isPortRegistered( port ) );
return _ports.find( port )->second.first;
}
int ProgramRegistry::portForPid(ProcessId pid) const {
- stdx::lock_guard<boost::recursive_mutex> lk(_mutex);
+ stdx::lock_guard<stdx::recursive_mutex> lk(_mutex);
for (map<int, pair<ProcessId, int> >::const_iterator it = _ports.begin();
it != _ports.end(); ++it)
{
@@ -112,41 +112,41 @@ namespace mongo {
}
void ProgramRegistry::registerPort( int port, ProcessId pid, int output ) {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
verify( !isPortRegistered( port ) );
_ports.insert( make_pair( port, make_pair( pid, output ) ) );
}
-
+
void ProgramRegistry::deletePort( int port ) {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
if ( !isPortRegistered( port ) ) {
return;
}
close( _ports.find( port )->second.second );
_ports.erase( port );
}
-
+
void ProgramRegistry::getRegisteredPorts( vector<int> &ports ) {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
for( map<int,pair<ProcessId,int> >::const_iterator i = _ports.begin(); i != _ports.end();
++i ) {
ports.push_back( i->first );
}
}
-
+
bool ProgramRegistry::isPidRegistered( ProcessId pid ) const {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
return _pids.count( pid ) == 1;
}
-
+
void ProgramRegistry::registerPid( ProcessId pid, int output ) {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
verify( !isPidRegistered( pid ) );
_pids.insert( make_pair( pid, output ) );
}
-
+
void ProgramRegistry::deletePid(ProcessId pid) {
- stdx::lock_guard<boost::recursive_mutex> lk(_mutex);
+ stdx::lock_guard<stdx::recursive_mutex> lk(_mutex);
if (!isPidRegistered(pid)) {
int port = portForPid(pid);
if (port < 0) return;
@@ -158,7 +158,7 @@ namespace mongo {
}
void ProgramRegistry::getRegisteredPids( vector<ProcessId> &pids ) {
- stdx::lock_guard<boost::recursive_mutex> lk( _mutex );
+ stdx::lock_guard<stdx::recursive_mutex> lk( _mutex );
for( map<ProcessId,int>::const_iterator i = _pids.begin(); i != _pids.end(); ++i ) {
pids.push_back( i->first );
}
diff --git a/src/mongo/shell/shell_utils_launcher.h b/src/mongo/shell/shell_utils_launcher.h
index 6cb5f5687b3..c0e038cc016 100644
--- a/src/mongo/shell/shell_utils_launcher.h
+++ b/src/mongo/shell/shell_utils_launcher.h
@@ -27,11 +27,9 @@
* then also delete it in the license file.
*/
-
#pragma once
#include <boost/filesystem/convenience.hpp>
-#include <boost/thread/recursive_mutex.hpp>
#include <map>
#include <sstream>
#include <string>
diff --git a/src/mongo/stdx/mutex.h b/src/mongo/stdx/mutex.h
index 071fa64bc0d..0eeb9163e17 100644
--- a/src/mongo/stdx/mutex.h
+++ b/src/mongo/stdx/mutex.h
@@ -30,12 +30,14 @@
#include <boost/thread/lock_guard.hpp>
#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
namespace mongo {
namespace stdx {
using boost::mutex;
using boost::timed_mutex;
+ using boost::recursive_mutex;
using boost::adopt_lock_t;
using boost::defer_lock_t;
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index 333861d66a9..10ceb0a5d3e 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -115,7 +115,7 @@ namespace mongo {
static void init() {
while ( (int)_mutex.size() < CRYPTO_num_locks() )
- _mutex.push_back( new boost::recursive_mutex );
+ _mutex.push_back( new stdx::recursive_mutex );
}
static SSLThreadInfo* get() {
@@ -134,7 +134,7 @@ namespace mongo {
// Note: see SERVER-8734 for why we are using a recursive mutex here.
// Once the deadlock fix in OpenSSL is incorporated into most distros of
// Linux, this can be changed back to a nonrecursive mutex.
- static std::vector<boost::recursive_mutex*> _mutex;
+ static std::vector<stdx::recursive_mutex*> _mutex;
static boost::thread_specific_ptr<SSLThreadInfo> _thread;
};
@@ -147,7 +147,7 @@ namespace mongo {
}
AtomicUInt32 SSLThreadInfo::_next;
- std::vector<boost::recursive_mutex*> SSLThreadInfo::_mutex;
+ std::vector<stdx::recursive_mutex*> SSLThreadInfo::_mutex;
boost::thread_specific_ptr<SSLThreadInfo> SSLThreadInfo::_thread;
////////////////////////////////////////////////////////////////