mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-06 08:58:35 +03:00
give up python interpreter lock before calling cb
suggested by danpb on irc, patch by danken fixed for proper C syntax * python/libvirt-override.c: on event callback release the python interpreter lock and take it again when coming back so that the callback can reinvoke libvirt.
This commit is contained in:
parent
4728bad403
commit
9ae8fa5839
@ -2354,8 +2354,11 @@ libvirt_virEventInvokeHandleCallback(PyObject *self ATTRIBUTE_UNUSED,
|
||||
cb = (virEventHandleCallback) PyvirEventHandleCallback_Get(py_f);
|
||||
opaque = (void *) PyvirVoidPtr_Get(py_opaque);
|
||||
|
||||
if(cb)
|
||||
if(cb) {
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
cb (watch, fd, event, opaque);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
}
|
||||
|
||||
return VIR_PY_INT_SUCCESS;
|
||||
}
|
||||
@ -2378,8 +2381,11 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED,
|
||||
|
||||
cb = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f);
|
||||
opaque = (void *) PyvirVoidPtr_Get(py_opaque);
|
||||
if(cb)
|
||||
if(cb) {
|
||||
LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
cb (timer, opaque);
|
||||
LIBVIRT_END_ALLOW_THREADS;
|
||||
}
|
||||
|
||||
return VIR_PY_INT_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user