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]
/
sel-timer.pyx
diff --git
a/sel-timer.pyx
b/sel-timer.pyx
index 261ecde10db47df064c3bb1f2fd4c61246e93ca1..db61a6c7ee3a1ab98b30c4e3f177be0342ef7bff 100644
(file)
--- a/
sel-timer.pyx
+++ b/
sel-timer.pyx
@@
-72,10
+72,14
@@
cdef class SelTimer:
def timer(me, now):
return _maybecall(me._timer, ())
def timer(me, now):
return _maybecall(me._timer, ())
-cdef void _timerfunc(timeval *now, void *arg):
+cdef void _timerfunc
2
(timeval *now, void *arg):
cdef SelTimer st
st = <SelTimer>arg
st._dead()
st.timer(_tvtofloat(now))
cdef SelTimer st
st = <SelTimer>arg
st._dead()
st.timer(_tvtofloat(now))
+cdef void _timerfunc(timeval *now, void *arg):
+ PyEval_AcquireLock()
+ _timerfunc2(now, arg)
+ PyEval_ReleaseLock()
#----- That's all, folks ----------------------------------------------------
#----- That's all, folks ----------------------------------------------------