python: Release Python GIL while running libguestfs calls.
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 18 Apr 2011 15:56:08 +0000 (16:56 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 18 Apr 2011 19:21:38 +0000 (20:21 +0100)
Release the Python global interpreter lock while running libguestfs
calls.

We don't release it around guestfs_create() because that is a short
call that just allocates memory.  We do release it around
guestfs_close() since that is a potentially long-running (it can call
wait(2) amongst other things).  We also release it around all the
other generated Python calls.

We don't yet support callbacks into Python code (ie. the new event
API).  But when we do in future, we will need to also handle the GIL
around those callbacks.

This code is adapted from libvirt's python/typewrappers.h.  Thanks to
Dan Berrange for showing us how to do this properly.


No differences found