diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2008-08-27 21:37:30 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2008-08-27 21:37:30 +0000 |
commit | 328b8849ee7e8db2cb02c710a2fadaaac20d0da3 (patch) | |
tree | 03220ac38ac3152f2c32da4f81e0017f5db0f35f /gobject | |
parent | a387a178ed400de963cedd56c6c43fe10f26913e (diff) | |
download | pygobject-328b8849ee7e8db2cb02c710a2fadaaac20d0da3.tar.gz |
Bug 547633 – cannot create new threads when pygtk is used
2008-08-28 Paul Pogonyshev <pogonyshev@gmx.net>
Bug 547633 – cannot create new threads when pygtk is used
* glib/pyglib.c (pyglib_notify_on_enabling_threads): New function.
(pyglib_enable_threads): Invoke all callbacks added with new
pyglib_notify_on_enabling_threads().
* gobject/gobjectmodule.c (pyg_note_threads_enabled): New
function (callback for new pyglib_notify_on_enabling_threads()).
(PYGLIB_MODULE_START): Initialize
'pygobject_api_functions.threads_enabled' and also watch for
thread being enabled later on.
svn path=/trunk/; revision=952
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/gobjectmodule.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 29ccdf28..95d1b765 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1812,6 +1812,12 @@ pygobject_enable_threads(void) return 0; } +static void +pyg_note_threads_enabled(void) +{ + pygobject_api_functions.threads_enabled = TRUE; +} + static PyObject * pyg_signal_accumulator_true_handled(PyObject *unused, PyObject *args) { @@ -2594,5 +2600,8 @@ PYGLIB_MODULE_START(_gobject, "gobject._gobject") /* signal registration recognizes this special accumulator 'constant' */ _pyg_signal_accumulator_true_handled_func = \ PyDict_GetItemString(d, "signal_accumulator_true_handled"); + + pygobject_api_functions.threads_enabled = pyglib_threads_enabled(); + pyglib_notify_on_enabling_threads(pyg_note_threads_enabled); } PYGLIB_MODULE_END |