diff utils.c @ 69:c2972e58fbb6

Made the conversion of JS exceptions into strings release the GIL.
author Atul Varma <varmaa@toolness.com>
date Sun, 26 Jul 2009 16:44:12 -0700
parents 427b01954b22
children e06376295170
line wrap: on
line diff
--- a/utils.c	Sun Jul 26 16:24:32 2009 -0700
+++ b/utils.c	Sun Jul 26 16:44:12 2009 -0700
@@ -205,7 +205,12 @@
 
   jsval val;
   if (JS_GetPendingException(context->cx, &val)) {
-    JSString *str = JS_ValueToString(context->cx, val);
+    JSString *str = NULL;
+
+    Py_BEGIN_ALLOW_THREADS;
+    str = JS_ValueToString(context->cx, val);
+    Py_END_ALLOW_THREADS;
+
     if (str != NULL) {
       // TODO: Wrap the original JS exception so that the client can
       // examine it.