[pygobject] Release GIL when calling into C functions



commit 1731f89e4b5a20c33976963e12a1f39a21d33fde
Author: John (J5) Palmieri <johnp redhat com>
Date:   Thu Oct 28 14:21:12 2010 -0400

    Release GIL when calling into C functions
    
    Author: Daniel P. Berrange <dan berrange com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629042

 gi/pygi-invoke.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c
index 64b3f31..b96eeaf 100644
--- a/gi/pygi-invoke.c
+++ b/gi/pygi-invoke.c
@@ -548,8 +548,16 @@ _invoke_function (struct invocation_state *state,
 
     error = NULL;
 
+    pyg_begin_allow_threads;
     retval = g_function_info_invoke ( (GIFunctionInfo *) function_info,
-                                      state->in_args, state->n_in_args, state->out_args, state->n_out_args, &state->return_arg, &error);
+                                      state->in_args,
+                                      state->n_in_args,
+                                      state->out_args,
+                                      state->n_out_args,
+                                      &state->return_arg,
+                                      &error);
+    pyg_end_allow_threads;
+
     if (!retval) {
         g_assert (error != NULL);
         /* TODO: raise the right error, out of the error domain. */



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