summaryrefslogtreecommitdiffstats
path: root/gobject/pygmainloop.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-08-03 14:11:46 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-08-03 14:11:46 +0000
commit90aaf720cefcaed82196ea275b3a513315877300 (patch)
tree3097d16165d7b0d8268e768cab019a553f2214b6 /gobject/pygmainloop.c
parent3e41db376f6e40c2df01a1f83c2ecf10a5315084 (diff)
downloadpygobject-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/pygmainloop.c')
-rw-r--r--gobject/pygmainloop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gobject/pygmainloop.c b/gobject/pygmainloop.c
index e0424cb..1a7e163 100644
--- a/gobject/pygmainloop.c
+++ b/gobject/pygmainloop.c
@@ -105,9 +105,9 @@ _wrap_g_main_loop_quit (PyGMainLoop *self)
static PyObject *
_wrap_g_main_loop_run (PyGMainLoop *self)
{
- pyg_unblock_threads();
+ Py_BEGIN_ALLOW_THREADS;
g_main_loop_run(self->loop);
- pyg_block_threads();
+ Py_END_ALLOW_THREADS;
Py_INCREF(Py_None);
return Py_None;