We've come up with a patch that solves the python global lock/gdk lock
interation problem - but I have no idea if it is at all safe.

 static PyObject *_wrap_gdk_threads_enter(PyObject *self, PyObject *args) {
   if (!PyArg_ParseTuple(args, ":gdk_threads_enter"))
     return NULL;
+  Py_BEGIN_ALLOW_THREADS
   gdk_threads_enter();
+  Py_END_ALLOW_THREADS
   Py_INCREF(Py_None);
   return Py_None;
}

 static PyObject *_wrap_gdk_threads_leave(PyObject *self, PyObject *args) {
   if (!PyArg_ParseTuple(args, ":gdk_threads_leave"))
     return NULL;
+  Py_BEGIN_ALLOW_THREADS    
   gdk_threads_leave();
+  Py_END_ALLOW_THREADS  
   Py_INCREF(Py_None);
   return Py_None;
 }

Now, this just means that while we're waiting around to aquire the gdk
lock we allow other python threads to run.  These other python threads
will most likely be releasing the gdk lock.  Now, we really probably
don't need the BEGIN/END around threads_leave, but it shouldn't hurt
at all (these operations are atomic, after all).

Phew....  let me know if this is completely braindead...

Matt

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to