From 474ca2a9bde78fcdbb059813936f05db1f04fac8 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Thu, 25 Feb 2010 21:22:41 +0000 Subject: [PATCH] mod_spidermonkey: suspend/resume ctx when sleeping git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16830 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 25d51cf5ea..7cf4d60293 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -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); }