зеркало из https://github.com/mozilla/pjs.git
Bug 412985 - "Provide stubs for JS_THREADSAFE APIs in non-JS_THREADSAFE builds" [p=jorendorff@mozilla.com (Jason Orendorff) r+a1.9=brendan]
This commit is contained in:
Родитель
93f610125f
Коммит
0e6964cb5f
|
@ -5691,7 +5691,6 @@ JS_ThrowStopIteration(JSContext *cx)
|
|||
return js_ThrowStopIteration(cx);
|
||||
}
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
/*
|
||||
* Get the owning thread id of a context. Returns 0 if the context is not
|
||||
* owned by any thread.
|
||||
|
@ -5699,7 +5698,11 @@ JS_ThrowStopIteration(JSContext *cx)
|
|||
JS_PUBLIC_API(jsword)
|
||||
JS_GetContextThread(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
return JS_THREAD_ID(cx);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5709,20 +5712,27 @@ JS_GetContextThread(JSContext *cx)
|
|||
JS_PUBLIC_API(jsword)
|
||||
JS_SetContextThread(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
jsword old = JS_THREAD_ID(cx);
|
||||
if (!js_SetContextThread(cx))
|
||||
return -1;
|
||||
return old;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(jsword)
|
||||
JS_ClearContextThread(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
jsword old = JS_THREAD_ID(cx);
|
||||
js_ClearContextThread(cx);
|
||||
return old;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
JS_PUBLIC_API(void)
|
||||
|
|
|
@ -2592,8 +2592,6 @@ JS_ThrowReportedError(JSContext *cx, const char *message,
|
|||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_ThrowStopIteration(JSContext *cx);
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
|
||||
/*
|
||||
* Associate the current thread with the given context. This is done
|
||||
* implicitly by JS_NewContext.
|
||||
|
@ -2612,8 +2610,6 @@ JS_SetContextThread(JSContext *cx);
|
|||
extern JS_PUBLIC_API(jsword)
|
||||
JS_ClearContextThread(JSContext *cx);
|
||||
|
||||
#endif /* JS_THREADSAFE */
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче