From: Richard W.M. Jones Date: Mon, 18 Apr 2011 15:56:08 +0000 (+0100) Subject: python: Release Python GIL while running libguestfs calls. X-Git-Tag: 1.11.2~1 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=08dc4a87b92435678780e9c49fe3bc1e7465d99f;hp=08dc4a87b92435678780e9c49fe3bc1e7465d99f;p=libguestfs.git python: Release Python GIL while running libguestfs calls. 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. ---