[libvirt] [PATCH] give up python interpreter lock before calling cb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



suggested by danpb on irc
---
 python/libvirt-override.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 5d24fd2..53e36c0 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -2355,7 +2355,9 @@ libvirt_virEventInvokeHandleCallback(PyObject *self ATTRIBUTE_UNUSED,
     opaque = (void *) PyvirVoidPtr_Get(py_opaque);
 
     if(cb)
+        LIBVIRT_BEGIN_ALLOW_THREADS
         cb (watch, fd, event, opaque);
+        LIBVIRT_END_ALLOW_THREADS
 
     return VIR_PY_INT_SUCCESS;
 }
@@ -2379,7 +2381,9 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED,
     cb     = (virEventTimeoutCallback) PyvirEventTimeoutCallback_Get(py_f);
     opaque = (void *) PyvirVoidPtr_Get(py_opaque);
     if(cb)
+        LIBVIRT_BEGIN_ALLOW_THREADS
         cb (timer, opaque);
+        LIBVIRT_END_ALLOW_THREADS
 
     return VIR_PY_INT_SUCCESS;
 }
-- 
1.6.2.5

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]