[Libguestfs] [libnbd PATCH] python: Correctly use PyGILState
Eric Blake
eblake at redhat.com
Fri Jun 10 18:22:46 UTC 2022
On Fri, Jun 10, 2022 at 08:31:43AM +0100, Richard W.M. Jones wrote:
> > Fix this by widening the scope of PyGILState in all callback wrappers
> > (all other code calling into Python is assumed to already own the
> > GIL), and by dropping the GIL around calls into libnbd C code.
> >
>
> Reviewed-by: Richard W.M. Jones <rjones at redhat.com>
>
> although maybe ...
>
> https://gitlab.com/nbdkit/nbdkit/-/blob/c96f025b39a3581405845004e1fcceb5dfa04583/plugins/python/plugin.h#L45
Yes, the auto-cleanup trick is cool, if we needed to use it in more
places than just one spot in the generator. For now, I just checked
in the patch as-is, commit 67dd054
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
More information about the Libguestfs
mailing list