gst/gstmodule.c (python_do_pending_calls): Use

Original commit message from CVS:
* gst/gstmodule.c (python_do_pending_calls): Use
PyOS_InterruptOccurred and only hold the GIL during
PyErr_SetNone. Use _pygst_main_quit to avoid errors/aborts. Also
use the pygtk provided gil macros instead of the python ones.
This commit is contained in:
Johan Dahlin 2004-09-29 11:13:21 +00:00
parent e6a9dec474
commit f915e8d473
2 changed files with 19 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2004-09-29 Johan Dahlin <johan@gnome.org>
* gst/gstmodule.c (python_do_pending_calls): Use
PyOS_InterruptOccurred and only hold the GIL during
PyErr_SetNone. Use _pygst_main_quit to avoid errors/aborts. Also
use the pygtk provided gil macros instead of the python ones.
2004-09-22 Johan Dahlin <johan@gnome.org>
* gst/gst.override: use new threading API

View file

@ -34,6 +34,8 @@ void pygst_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef pygst_functions[];
extern GSList *mainloops;
extern void _pygst_main_quit(void);
static gboolean
python_do_pending_calls(gpointer data)
@ -41,15 +43,17 @@ python_do_pending_calls(gpointer data)
gboolean quit = FALSE;
PyGILState_STATE state;
state = PyGILState_Ensure();
if (PyErr_CheckSignals() == -1) {
PyErr_SetNone(PyExc_KeyboardInterrupt);
quit = TRUE;
}
if (quit && mainloops != NULL)
gst_main_quit();
if (PyOS_InterruptOccurred()) {
state = pyg_gil_state_ensure();
PyErr_SetNone(PyExc_KeyboardInterrupt);
pyg_gil_state_release(state);
quit = TRUE;
}
if (quit && mainloops != NULL)
_pygst_main_quit();
PyGILState_Release(state);
return TRUE;
}