diff options
| author | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 14:11:46 +0000 |
|---|---|---|
| committer | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 14:11:46 +0000 |
| commit | 90aaf720cefcaed82196ea275b3a513315877300 (patch) | |
| tree | 3097d16165d7b0d8268e768cab019a553f2214b6 /gobject/pygmaincontext.c | |
| parent | 3e41db376f6e40c2df01a1f83c2ecf10a5315084 (diff) | |
| download | pygobject-90aaf720cefcaed82196ea275b3a513315877300.tar.gz pygobject-90aaf720cefcaed82196ea275b3a513315877300.tar.xz pygobject-90aaf720cefcaed82196ea275b3a513315877300.zip | |
Clean up most functions here to have only one return path.
* gtk/pygtktreemodel.c: Clean up most functions here to have only
one return path.
* gobject/pygobject.c (pygobject_emit): Protect g_value_unset by
UNBLOCK/BLOCK_THREADS since it might call pygobject_free which
will result in a deadlock.
* gobject/gobjectmodule.c (pyg_thread_init): New function, move
thread initalization stuff in here.
* All over the place: Kill pyg_block/unblock_threads and use
PyGILState and Py_BEGIN/END_ALLOW_THREADS.
unblock [code] block calls are replaced by Py_BEGIN/END and
block [code] unblock calls are replaced by PyGILState.
Diffstat (limited to 'gobject/pygmaincontext.c')
| -rw-r--r-- | gobject/pygmaincontext.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gobject/pygmaincontext.c b/gobject/pygmaincontext.c index 7f8fdab..ee803c8 100644 --- a/gobject/pygmaincontext.c +++ b/gobject/pygmaincontext.c @@ -51,10 +51,10 @@ _wrap_g_main_context_iteration (PyGMainContext *self, PyObject *args) &may_block)) return NULL; - pyg_unblock_threads(); + Py_BEGIN_ALLOW_THREADS; py_ret = g_main_context_iteration(self->context, may_block) ? Py_True : Py_False; - pyg_block_threads(); + Py_END_ALLOW_THREADS; Py_INCREF(py_ret); return py_ret; |
