Acquire and release the GIL around select callbacks.
[mLib-python] / ident.pyx
index d19c3a4..e7c05d2 100644 (file)
--- a/ident.pyx
+++ b/ident.pyx
@@ -157,7 +157,7 @@ cdef class SelIdentify:
   def bogus(me):
     return _maybecall(me._bogus, ())
 
-cdef void _identfunc(ident_reply *i, void *arg):
+cdef void _identfunc2(ident_reply *i, void *arg):
   cdef SelIdentify id
   id = <SelIdentify>arg
   id._dead()
@@ -167,5 +167,9 @@ cdef void _identfunc(ident_reply *i, void *arg):
     id.error(i.u.error)
   elif i.type == IDENT_USERID:
     id.user(i.u.userid.os, i.u.userid.user)
+cdef void _identfunc(ident_reply *i, void *arg):
+  PyEval_AcquireLock()
+  _identfunc2(i, arg)
+  PyEval_ReleaseLock()
 
 #----- That's all, folks ----------------------------------------------------