summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-01-25 10:27:21 -0800
committerAaron <aaron@10gen.com>2010-01-25 10:27:21 -0800
commit1664c3da4f7c54ce014fec9e6f1e77c61130661d (patch)
treef0cfaa65a6480e87611c92b4bc889d88e8964b72 /scripting
parent68b9522a09d99951a0d29ff34707c71176533ee1 (diff)
downloadmongo-1664c3da4f7c54ce014fec9e6f1e77c61130661d.tar.gz
SERVER-512 prevent ugly boost assert on shell shutdown
Diffstat (limited to 'scripting')
-rw-r--r--scripting/engine.cpp1
-rw-r--r--scripting/engine_spidermonkey.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/scripting/engine.cpp b/scripting/engine.cpp
index dc088fbd86c..3d04faae88f 100644
--- a/scripting/engine.cpp
+++ b/scripting/engine.cpp
@@ -217,6 +217,7 @@ namespace mongo {
return;
clear();
+ _mutex.unlock(); // boost will assert if the mutex is destroyed while locked
}
void done( const string& pool , Scope * s ){
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp
index 4b395f560b2..670ccd2cf5e 100644
--- a/scripting/engine_spidermonkey.cpp
+++ b/scripting/engine_spidermonkey.cpp
@@ -45,7 +45,7 @@ namespace mongo {
}
boost::thread_specific_ptr<SMScope> currentScope( dontDeleteScope );
- boost::recursive_mutex smmutex;
+ boost::recursive_mutex &smmutex = *( new boost::recursive_mutex );
#define smlock recursive_boostlock ___lk( smmutex );
#define GETHOLDER(x,o) ((BSONHolder*)JS_GetPrivate( x , o ))