diff options
author | Paul Pogonyshev <pogonyshev@gmx.net> | 2008-08-03 15:35:17 +0000 |
---|---|---|
committer | Paul Pogonyshev <paulp@src.gnome.org> | 2008-08-03 15:35:17 +0000 |
commit | cc630ab67b9483f9c3c71ffa2ecffee7d61bed8c (patch) | |
tree | 7d886bd248d9728bf3f75c1957294de4d6d53d1a /glib/pyglib.c | |
parent | 24469111668f8543616f93d0cf5ab797adbc103f (diff) | |
download | pygobject-cc630ab67b9483f9c3c71ffa2ecffee7d61bed8c.tar.gz pygobject-cc630ab67b9483f9c3c71ffa2ecffee7d61bed8c.tar.xz pygobject-cc630ab67b9483f9c3c71ffa2ecffee7d61bed8c.zip |
Change return value from 'gboolean' to 'int' and changed semantics to
2008-08-03 Paul Pogonyshev <pogonyshev@gmx.net>
* glib/pyglib.h:
* glib/pyglib.c (pyglib_enable_threads): Change return value from
'gboolean' to 'int' and changed semantics to Pythonic: restores
backwards compatibility.
* gobject/gobjectmodule.c (pyg_threads_init): Treat return value
accordingly (bug #544946).
svn path=/trunk/; revision=922
Diffstat (limited to 'glib/pyglib.c')
-rw-r--r-- | glib/pyglib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/glib/pyglib.c b/glib/pyglib.c index 1c33995..3dd05a4 100644 --- a/glib/pyglib.c +++ b/glib/pyglib.c @@ -119,24 +119,24 @@ pyglib_gil_state_release(PyGILState_STATE state) } #ifdef DISABLE_THREADING -gboolean +int pyglib_enable_threads(void) { PyErr_SetString(PyExc_RuntimeError, "pyglib threading disabled at compile time"); - return FALSE; + return -1; } #else /* Enable threading; note that the GIL must be held by the current * thread when this function is called */ -gboolean +int pyglib_enable_threads(void) { - g_return_val_if_fail (_PyGLib_API != NULL, FALSE); + g_return_val_if_fail (_PyGLib_API != NULL, -1); if (_PyGLib_API->threads_enabled) - return TRUE; + return 0; PyEval_InitThreads(); if (!g_threads_got_initialized) @@ -145,7 +145,7 @@ pyglib_enable_threads(void) _PyGLib_API->threads_enabled = TRUE; pyglib_thread_state_tls_key = PyThread_create_key(); - return TRUE; + return 0; } #endif |