[Libguestfs] [PATCH nbdkit 1/4] python: Make last_error into a thread-local variable.

Richard W.M. Jones rjones at redhat.com
Wed Aug 5 16:40:06 UTC 2020


While with the current thread model this makes no difference, it is
required if we want to allow more parallel thread models.
---
 plugins/python/python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/python/python.c b/plugins/python/python.c
index f21a1602..9fa89964 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -63,7 +63,7 @@ static const char *script;
 static PyObject *module;
 static int py_api_version = 1;
 
-static int last_error;
+static __thread int last_error;
 
 /* Is a callback defined? */
 static int
-- 
2.27.0




More information about the Libguestfs mailing list