diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 16:31:32 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 16:31:32 +0000 |
commit | 97cc9ad8f4ac2c74a7b32cdca403a44a12f1e3c8 (patch) | |
tree | 2e2059a2945801667b059985a867becd760bb027 /gobject | |
parent | 826275d0003d570ad174e74ab17783c4a9263cba (diff) | |
download | pygobject-97cc9ad8f4ac2c74a7b32cdca403a44a12f1e3c8.tar.gz |
More minor threading fixes
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/gobjectmodule.c | 7 | ||||
-rw-r--r-- | gobject/pygobject.c | 7 | ||||
-rw-r--r-- | gobject/pygobject.h | 6 |
3 files changed, 4 insertions, 16 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index b86e2b87..4fd09cef 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1463,8 +1463,8 @@ pyg_thread_init (PyObject *unused) have threading enabled. This will make the import/initialize code quite ugly */ #ifdef ENABLE_PYGTK_THREADING - g_print ("calling InitThreads\n"); PyEval_InitThreads(); + if (!g_threads_got_initialized) g_thread_init(NULL); #endif @@ -1830,11 +1830,6 @@ initgobject(void) m = Py_InitModule("gobject", pygobject_functions); d = PyModule_GetDict(m); -#ifdef ENABLE_PYGTK_THREADING - if (!g_threads_got_initialized) - g_thread_init(NULL); -#endif - g_type_init(); PY_TYPE_OBJECT = g_boxed_type_register_static("PyObject", diff --git a/gobject/pygobject.c b/gobject/pygobject.c index ac51daf7..c5215aee 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1039,10 +1039,10 @@ pygobject_emit(PyGObject *self, PyObject *args) item->ob_type->tp_name, g_type_name(G_VALUE_TYPE(¶ms[i+1])), i); PyErr_SetString(PyExc_TypeError, buf); - Py_UNBLOCK_THREADS; + for (i = 0; i < query.n_params + 1; i++) g_value_unset(¶ms[i]); - Py_BLOCK_THREADS; + g_free(params); return NULL; } @@ -1051,7 +1051,7 @@ pygobject_emit(PyGObject *self, PyObject *args) g_value_init(&ret, query.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE); g_signal_emitv(params, signal_id, detail, &ret); - Py_UNBLOCK_THREADS; + for (i = 0; i < query.n_params + 1; i++) g_value_unset(¶ms[i]); @@ -1063,7 +1063,6 @@ pygobject_emit(PyGObject *self, PyObject *args) Py_INCREF(Py_None); py_ret = Py_None; } - Py_BLOCK_THREADS; return py_ret; } diff --git a/gobject/pygobject.h b/gobject/pygobject.h index ebddca09..c9cebfed 100644 --- a/gobject/pygobject.h +++ b/gobject/pygobject.h @@ -7,12 +7,6 @@ #include <glib.h> #include <glib-object.h> -#if !(defined ENABLE_PYGTK_THREADING) -# define PyGILState_STATE int -# define PyGILState_Ensure() (0) -# define PyGILState_Release(x) -#endif - typedef struct { PyObject_HEAD GObject *obj; |