diff function.c @ 66:b49180c39d0a

Pymonkey now handles the GIL properly so that Python code can run while JS code does.
author Atul Varma <varmaa@toolness.com>
date Sun, 26 Jul 2009 15:06:19 -0700
parents f89a582c1276
children 19f3bc257a25
line wrap: on
line diff
--- a/function.c	Sun Jul 26 13:09:58 2009 -0700
+++ b/function.c	Sun Jul 26 15:06:19 2009 -0700
@@ -52,6 +52,7 @@
 static void
 PYM_finalizeFunctionHolder(JSContext *cx, JSObject *obj)
 {
+  PYM_PyAutoEnsureGIL gil;
   PyObject *callable;
   if (PYM_getHeldFunction(cx, obj, &callable))
     Py_DECREF(callable);
@@ -95,6 +96,7 @@
                                jsval *argv,
                                jsval *rval)
 {
+  PYM_PyAutoEnsureGIL gil;
   jsval callee = JS_ARGV_CALLEE(argv);
   jsval functionHolder;
   if (!JS_GetReservedSlot(cx, JSVAL_TO_OBJECT(callee), 0, &functionHolder)) {