GNOME Bugzilla – Bug 699440
Remove and cleanup thread related functions and macros
Last modified: 2017-03-22 08:29:53 UTC
We can remove the following functions: gi/_glib/pyglib.c pyglib_block_threads pyglib_unblock_threads pyglib_set_thread_block_funcs Threading related macros should be replaced with direct usage of the Python C API: pyg_begin/end_allow_threads -> Py_BEGIN/END_ALLOW_THREADS pyglib_begin/end_allow_threads -> Py_BEGIN/END_ALLOW_THREADS etc...
Created attachment 243151 [details] [review] Remove and deprecate API for setting of thread blocking functions Remove pyglib_set_thread_block_funcs and deprecate pyg_set_thread_block_funcs. The thread block function APIs are no longer be neccessary because PyGObject can use the Python C API directly when working with threads.
Created attachment 243154 [details] [review] Replace usage of pyg_begin_allow_threads with Py_BEGIN_ALLOW_THREADS Replace all usage of pyg[lib]_begin_allow_threads with direct usage of Py_BEGIN_ALLOW_THREADS.
Comment on attachment 243151 [details] [review] Remove and deprecate API for setting of thread blocking functions Thanks!
Comment on attachment 243151 [details] [review] Remove and deprecate API for setting of thread blocking functions Attachment 243151 [details] pushed as c9e9566 - Remove and deprecate API for setting of thread blocking functions
Comment on attachment 243154 [details] [review] Replace usage of pyg_begin_allow_threads with Py_BEGIN_ALLOW_THREADS Leaving open for now. There is still pyglib_gil_state_ensure to look into replacing with PyGILState_Ensure. Attachment 243154 [details] pushed as 87e41db - Replace usage of pyg_begin_allow_threads with Py_BEGIN_ALLOW_THREADS
Created attachment 348439 [details] [review] Remove support for building without threads This removes the --disable-thread configure option. * glib removed disable-threads in 2011 * We use PyEval_InitThreads() for some time now which means we build against a Python with threads. And nobody complained.
Created attachment 348440 [details] [review] Remove pyglib_gil_state_ensure/pyglib_gil_state_release Use PyGILState_Ensure/PyGILState_Release instead.
Review of attachment 348439 [details] [review]: Sure.
Review of attachment 348440 [details] [review]: Thanks.
Thanks