summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--glib/pyglib.c4
-rw-r--r--glib/pyglib.h4
-rw-r--r--gobject/gobjectmodule.c2
4 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 514f324..d2e89b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,12 +17,13 @@
Bug 547633 – cannot create new threads when pygtk is used
- * glib/pyglib.c (pyglib_notify_on_enabling_threads): New function.
+ * glib/pyglib.c (_pyglib_notify_on_enabling_threads): New
+ function.
(pyglib_enable_threads): Invoke all callbacks added with new
- pyglib_notify_on_enabling_threads().
+ _pyglib_notify_on_enabling_threads().
* gobject/gobjectmodule.c (pyg_note_threads_enabled): New
- function (callback for new pyglib_notify_on_enabling_threads()).
+ 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.
diff --git a/glib/pyglib.c b/glib/pyglib.c
index 4d8ea8b..4dabb19 100644
--- a/glib/pyglib.c
+++ b/glib/pyglib.c
@@ -137,7 +137,7 @@ pyglib_enable_threads(void)
}
void
-pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback)
+_pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback)
{
/* Ignore, threads cannot be enabled. */
}
@@ -174,7 +174,7 @@ pyglib_enable_threads(void)
}
void
-pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback)
+_pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback)
{
if (callback && !pyglib_threads_enabled())
thread_enabling_callbacks = g_slist_append(thread_enabling_callbacks, callback);
diff --git a/glib/pyglib.h b/glib/pyglib.h
index 6b476e0..85b7575 100644
--- a/glib/pyglib.h
+++ b/glib/pyglib.h
@@ -36,7 +36,6 @@ void pyglib_init_internal(PyObject *api);
PyGILState_STATE pyglib_gil_state_ensure(void);
void pyglib_gil_state_release(PyGILState_STATE state);
int pyglib_enable_threads(void);
-void pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback);
gboolean pyglib_error_check(GError **error);
gboolean pyglib_gerror_exception_check(GError **error);
PyObject *pyglib_register_exception_for_domain(gchar *name,
@@ -52,6 +51,9 @@ PyObject * pyglib_option_group_new(GOptionGroup *group);
GOptionGroup * pyglib_option_group_transfer_group(PyObject *self);
PyObject * pyglib_float_from_timeval(GTimeVal timeval);
+/* Private: for gobject <-> glib interaction only. */
+void _pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback);
+
#define pyglib_begin_allow_threads \
G_STMT_START { \
PyThreadState *_save = NULL; \
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 95d1b76..aa7ee49 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2602,6 +2602,6 @@ PYGLIB_MODULE_START(_gobject, "gobject._gobject")
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_notify_on_enabling_threads(pyg_note_threads_enabled);
}
PYGLIB_MODULE_END