Acquire and release the GIL around select callbacks.
[mLib-python] / sel-base.pyx
index e7b4fbe..6a5e2c3 100644 (file)
 cdef sel_state _sel
 
 def select():
-  if sel_select(&_sel) and errno != EINTR and errno != EAGAIN:
+  cdef int rc
+  PyEval_ReleaseLock()
+  rc = sel_select(&_sel)
+  PyEval_AcquireLock()
+  if rc and errno != EINTR and errno != EAGAIN:
     _oserror()
 
 sel_init(&_sel)