chiark
/
gitweb
/
~mdw
/
mLib-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Acquire and release the GIL around select callbacks.
[mLib-python]
/
selbuf.pyx
diff --git
a/selbuf.pyx
b/selbuf.pyx
index 4a5a28898ca9e72ac1b2a3901d3846fc23d36b10..b8fae431f8c9b74ff80af5d029e37cac3976ccb2 100644
(file)
--- a/
selbuf.pyx
+++ b/
selbuf.pyx
@@
-95,12
+95,16
@@
cdef class SelLineBuffer:
def eof(me):
return _maybecall(me._eof, ())
def eof(me):
return _maybecall(me._eof, ())
-cdef void _selbfunc(char *s, size_t n, void *arg):
+cdef void _selbfunc
2
(char *s, size_t n, void *arg):
cdef SelLineBuffer sb
sb = <SelLineBuffer>arg
if s is NULL:
sb.eof()
else:
sb.line(PyString_FromStringAndSize(s, n))
cdef SelLineBuffer sb
sb = <SelLineBuffer>arg
if s is NULL:
sb.eof()
else:
sb.line(PyString_FromStringAndSize(s, n))
+cdef void _selbfunc(char *s, size_t n, void *arg):
+ PyEval_AcquireLock()
+ _selbfunc2(s, n, arg)
+ PyEval_ReleaseLock()
#----- That's all, folks ----------------------------------------------------
#----- That's all, folks ----------------------------------------------------