summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-03-15 09:42:01 -0700
committerAaron <aaron@10gen.com>2010-03-15 09:42:01 -0700
commitc971842a5598d50ce178840b33282a832b9d5d82 (patch)
treef9529392ef0151c60bf9378d12b402afac5da918 /shell
parent31330598f556770648d260ffcb04dabfd92ba498 (diff)
downloadmongo-c971842a5598d50ce178840b33282a832b9d5d82.tar.gz
Revert "Revert "SERVER-695 don't destroy static global mutexes""
This reverts commit eb7cde3e751b02eae055a922af8985fe52c807fa. Conflicts: db/instance.h
Diffstat (limited to 'shell')
-rw-r--r--shell/dbshell.cpp1
-rw-r--r--shell/utils.cpp8
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_;
}