mod_spidermonkey: suspend/resume ctx when sleeping
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16830 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1207c64a5a
commit
474ca2a9bd
|
@ -3380,7 +3380,10 @@ static JSBool js_api_sleep(JSContext * cx, JSObject * obj, uintN argc, jsval * a
|
|||
}
|
||||
|
||||
if (msec) {
|
||||
int saveDepth;
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
switch_yield(msec * 1000);
|
||||
JS_ResumeRequest(cx, saveDepth);
|
||||
} else {
|
||||
eval_some_js("~throw new Error(\"No Time specified\");", cx, obj, rval);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue