mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 12:45:27 +00:00
Bug 402898 - "JS_YieldRequest doesn't do scope-sharing" [p=jorendorff@mozilla.com (Jason Orendorff) r+a1.9=brendan]
This commit is contained in:
parent
5528a0b407
commit
bfcf87f43b
@ -927,27 +927,9 @@ JS_PUBLIC_API(void)
|
||||
JS_YieldRequest(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
JSRuntime *rt;
|
||||
|
||||
JS_ASSERT(cx->thread);
|
||||
CHECK_REQUEST(cx);
|
||||
|
||||
rt = cx->runtime;
|
||||
JS_LOCK_GC(rt);
|
||||
JS_ASSERT(rt->requestCount > 0);
|
||||
rt->requestCount--;
|
||||
if (rt->requestCount == 0)
|
||||
JS_NOTIFY_REQUEST_DONE(rt);
|
||||
JS_UNLOCK_GC(rt);
|
||||
/* XXXbe give the GC or another request calling it a chance to run here?
|
||||
Assumes FIFO scheduling */
|
||||
JS_LOCK_GC(rt);
|
||||
if (rt->gcThread != cx->thread) {
|
||||
while (rt->gcLevel > 0)
|
||||
JS_AWAIT_GC_DONE(rt);
|
||||
}
|
||||
rt->requestCount++;
|
||||
JS_UNLOCK_GC(rt);
|
||||
JS_ResumeRequest(cx, JS_SuspendRequest(cx));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user