]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_spidermonkey: suspend/resume ctx when sleeping
authorMathieu Rene <mrene@avgs.ca>
Thu, 25 Feb 2010 21:22:41 +0000 (21:22 +0000)
committerMathieu Rene <mrene@avgs.ca>
Thu, 25 Feb 2010 21:22:41 +0000 (21:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16830 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index 25d51cf5ea666655703ac51a6ba7ac9aec2535ec..7cf4d602935706ef01cebe4d259cc13d940dcae5 100644 (file)
@@ -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);
        }