summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-05-15 13:40:10 -0400
committerAaron <aaron@10gen.com>2009-05-15 13:40:10 -0400
commitf555dd3f9384c4b25c964544395bbd2f1615b846 (patch)
tree12e6cea7f3579a0de35dacfc869f31fac23d03de
parent3c9ffd3e34d0680c7a6efb6352d6dd6cdd6d3694 (diff)
downloadmongo-f555dd3f9384c4b25c964544395bbd2f1615b846.tar.gz
don't define JS_THREADSAFE
-rw-r--r--scripting/engine_spidermonkey.h2
-rw-r--r--scripting/sm_db.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/scripting/engine_spidermonkey.h b/scripting/engine_spidermonkey.h
index e5382e91d25..7a98ba77fb2 100644
--- a/scripting/engine_spidermonkey.h
+++ b/scripting/engine_spidermonkey.h
@@ -2,7 +2,7 @@
#pragma once
-#define JS_THREADSAFE
+//#define JS_THREADSAFE
#include "engine.h"
diff --git a/scripting/sm_db.cpp b/scripting/sm_db.cpp
index e3245212d7c..2362bedf557 100644
--- a/scripting/sm_db.cpp
+++ b/scripting/sm_db.cpp
@@ -538,7 +538,9 @@ namespace mongo {
public:
JSThread( JSThreadConfig &config ) : config_( config ) {}
void operator()() {
+#ifdef JS_THREADSAFE
JS_SetContextThread( config_.scope_->context() );
+#endif
try {
massert( "function call failure",
JS_TRUE == JS_CallFunction( config_.scope_->context(), config_.obj_, config_.f_, config_.argc_, config_.argv_.get(), &config_.returnData_ ) );
@@ -546,7 +548,9 @@ namespace mongo {
config_.done_ = true;
} catch ( ... ) {
}
+#ifdef JS_THREADSAFE
JS_ClearContextThread( config_.scope_->context() );
+#endif
}
private:
JSThreadConfig &config_;