diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-20 14:17:04 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-20 14:17:04 +0000 |
commit | 45ccf5f6ff1a1805ed326b397c70cf55bba28124 (patch) | |
tree | 59b30668a1b28efced9f417b1e6bc2f4bc9709ec /gobject/pygtype.c | |
parent | 9cd866c9066eaa933b54e77225ada672fcfacad3 (diff) | |
download | pygobject-45ccf5f6ff1a1805ed326b397c70cf55bba28124.tar.gz |
Move maincontext and mainloop over to glib. Update the threadstate api to
2008-07-20 Johan Dahlin <johan@gnome.org>
* glib/Makefile.am:
* glib/glibmodule.c (pyglib_main_context_default), (init_glib):
* glib/pyglib.c (pyglib_init), (pyglib_threads_enabled),
(pyglib_main_context_new):
* glib/pyglib.h:
* glib/pygmaincontext.c (_wrap_g_main_context_iteration),
(pyglib_maincontext_register_types):
* glib/pygmaincontext.h:
* glib/pygmainloop.c (pyg_signal_watch_prepare),
(pyg_signal_watch_check), (pyg_main_loop_new),
(_wrap_g_main_loop_get_context), (_wrap_g_main_loop_run),
(pyglib_mainloop_register_types):
* glib/pygmainloop.h:
* gobject/Makefile.am:
* gobject/__init__.py:
* gobject/gobjectmodule.c (pyg_destroy_notify), (pyobject_free),
(pyg_object_set_property), (pyg_object_get_property),
(_pyg_signal_accumulator), (pygobject__g_instance_init),
(pyg_handler_marshal), (pygobject_gil_state_ensure),
(pygobject_gil_state_release), (marshal_emission_hook),
(_log_func), (init_gobject):
* gobject/pygboxed.c (pyg_boxed_dealloc), (pyg_boxed_new):
* gobject/pygenum.c (pyg_enum_add):
* gobject/pygflags.c (pyg_flags_add):
* gobject/pygiochannel.c (pyg_iowatch_marshal):
* gobject/pygmaincontext.c:
* gobject/pygmainloop.c:
* gobject/pygobject-private.h:
* gobject/pygobject.c (pygobject_data_free), (pyg_toggle_notify),
(pygobject_new_with_interfaces), (pygobject_weak_ref_notify):
* gobject/pygobject.h:
* gobject/pygoptiongroup.c (destroy_g_group), (arg_func):
* gobject/pygpointer.c (pyg_pointer_new):
* gobject/pygsource.c (pyg_source_get_context),
(pyg_source_prepare), (pyg_source_check), (pyg_source_dispatch),
(pyg_source_finalize):
* gobject/pygtype.c (pyg_closure_invalidate),
(pyg_closure_marshal), (pyg_signal_class_closure_marshal):
* tests/common.py:
Move maincontext and mainloop over to glib.
Update the threadstate api to use the variant in glib.
svn path=/trunk/; revision=843
Diffstat (limited to 'gobject/pygtype.c')
-rw-r--r-- | gobject/pygtype.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c index 897234a7..eb5b0bca 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -20,6 +20,8 @@ * USA */ +#include <pyglib.h> + #include "pygobject-private.h" /* -------------- __gtype__ objects ---------------------------- */ @@ -1076,11 +1078,11 @@ pyg_closure_invalidate(gpointer data, GClosure *closure) PyGClosure *pc = (PyGClosure *)closure; PyGILState_STATE state; - state = pyg_gil_state_ensure(); + state = pyglib_gil_state_ensure(); Py_XDECREF(pc->callback); Py_XDECREF(pc->extra_args); Py_XDECREF(pc->swap_data); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); pc->callback = NULL; pc->extra_args = NULL; @@ -1100,7 +1102,7 @@ pyg_closure_marshal(GClosure *closure, PyObject *params, *ret; guint i; - state = pyg_gil_state_ensure(); + state = pyglib_gil_state_ensure(); /* construct Python tuple for the parameter values */ params = PyTuple_New(n_param_values); @@ -1148,7 +1150,7 @@ pyg_closure_marshal(GClosure *closure, out: Py_DECREF(params); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); } /** @@ -1241,7 +1243,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, PyObject *params, *ret; guint i, len; - state = pyg_gil_state_ensure(); + state = pyglib_gil_state_ensure(); g_return_if_fail(invocation_hint != NULL); /* get the object passed as the first argument to the closure */ @@ -1267,7 +1269,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, if (!method) { PyErr_Clear(); Py_DECREF(object_wrapper); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); return; } Py_DECREF(object_wrapper); @@ -1281,7 +1283,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, /* error condition */ if (!item) { Py_DECREF(params); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); return; } PyTuple_SetItem(params, i - 1, item); @@ -1308,7 +1310,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, PyErr_Print(); Py_DECREF(method); Py_DECREF(params); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); return; } Py_DECREF(method); @@ -1316,7 +1318,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, if (return_value) pyg_value_from_pyobject(return_value, ret); Py_DECREF(ret); - pyg_gil_state_release(state); + pyglib_gil_state_release(state); } /** |