From 6ccd4fae6a27c8f421e18cc918df62440b93c965 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 2 Feb 2011 11:20:03 -0600 Subject: [PATCH] Sprinkle #ifdef JS_THREADSAFE so the non-threadsafe shell builds again. It was broken by 641a33d0932f (bug 626743). --- js/src/jsdbgapi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index a658c20589f6..81fa39d80cf9 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -130,7 +130,9 @@ JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug) // Find all live scripts JSContext *iter = NULL; +#ifdef JS_THREADSAFE jsword currentThreadId = reinterpret_cast(js_CurrentThreadId()); +#endif typedef HashSet, ContextAllocPolicy> ScriptMap; ScriptMap liveScripts(cx); if (!liveScripts.init()) @@ -138,9 +140,11 @@ JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug) JSContext *icx; while ((icx = JS_ContextIterator(rt, &iter))) { +#ifdef JS_THREADSAFE if (JS_GetContextThread(icx) != currentThreadId) continue; - +#endif + for (AllFramesIter i(icx); !i.done(); ++i) { JSScript *script = i.fp()->maybeScript(); if (script)