Landing fix for bug 442708. JS_GC with GC_SET_SLOT_REQUEST doesn't loop until all threads are satisfied. Patch by brendan@mozilla.org, r=bent.mozilla@gmail.com

This commit is contained in:
Johnny Stenback
2008-07-21 16:58:24 -07:00
parent 28e7a16339
commit 21836e161e

View File

@@ -301,8 +301,13 @@ js_SetProtoOrParent(JSContext *cx, JSObject *obj, uint32 slot, JSObject *pobj)
JS_LOCK_GC(rt);
ssr.next = rt->setSlotRequests;
rt->setSlotRequests = &ssr;
js_GC(cx, GC_SET_SLOT_REQUEST);
JS_UNLOCK_GC(rt);
for (;;) {
js_GC(cx, GC_SET_SLOT_REQUEST);
JS_UNLOCK_GC(rt);
if (!rt->setSlotRequests)
break;
JS_LOCK_GC(rt);
}
if (ssr.errnum != JSMSG_NOT_AN_ERROR) {
if (ssr.errnum == JSMSG_OUT_OF_MEMORY) {