diff options
author | Aaron <aaron@10gen.com> | 2010-03-09 23:59:10 -0800 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2010-03-09 23:59:10 -0800 |
commit | 714ec2fdc8e9c8dc1c2cdf5486afdbc185beef14 (patch) | |
tree | 15fa091882a0f5aebed372b6f6742f422a67aa36 /shell | |
parent | c4b55b2957e0ac13b918212fff72656c448532f9 (diff) | |
download | mongo-714ec2fdc8e9c8dc1c2cdf5486afdbc185beef14.tar.gz |
SERVER-695 don't destroy static global mutexes
Diffstat (limited to 'shell')
-rw-r--r-- | shell/dbshell.cpp | 1 | ||||
-rw-r--r-- | shell/utils.cpp | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp index 47109f7a37c..5f1a82c0959 100644 --- a/shell/dbshell.cpp +++ b/shell/dbshell.cpp @@ -525,6 +525,7 @@ int _main(int argc, char* argv[]) { } int main(int argc, char* argv[]) { + static mongo::StaticObserver staticObserver; try { return _main( argc , argv ); } diff --git a/shell/utils.cpp b/shell/utils.cpp index 6ba70f12b70..b10c93d41c0 100644 --- a/shell/utils.cpp +++ b/shell/utils.cpp @@ -195,11 +195,11 @@ namespace mongo { map< pid_t, HANDLE > handles; #endif - boost::mutex &mongoProgramOutputMutex( *( new boost::mutex ) ); + mongo::mutex mongoProgramOutputMutex; stringstream mongoProgramOutput_; void writeMongoProgramOutputLine( int port, int pid, const char *line ) { - boost::mutex::scoped_lock lk( mongoProgramOutputMutex ); + mongo::mutex::scoped_lock lk( mongoProgramOutputMutex ); stringstream buf; if ( port > 0 ) buf << "m" << port << "| " << line; @@ -211,7 +211,7 @@ namespace mongo { // only returns last 100000 characters BSONObj RawMongoProgramOutput( const BSONObj &args ) { - boost::mutex::scoped_lock lk( mongoProgramOutputMutex ); + mongo::mutex::scoped_lock lk( mongoProgramOutputMutex ); string out = mongoProgramOutput_.str(); size_t len = out.length(); if ( len > 100000 ) @@ -220,7 +220,7 @@ namespace mongo { } BSONObj ClearRawMongoProgramOutput( const BSONObj &args ) { - boost::mutex::scoped_lock lk( mongoProgramOutputMutex ); + mongo::mutex::scoped_lock lk( mongoProgramOutputMutex ); mongoProgramOutput_.str( "" ); return undefined_; } |