Sprinkle #ifdef JS_THREADSAFE so the non-threadsafe shell builds again. It was broken by 641a33d0932f (bug 626743).

This commit is contained in:
Jason Orendorff 2011-02-02 11:20:03 -06:00
Родитель 4a60b81db6
Коммит 6ccd4fae6a
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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<jsword>(js_CurrentThreadId());
#endif
typedef HashSet<JSScript *, DefaultHasher<JSScript*>, 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)