After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699440 - Remove and cleanup thread related functions and macros
Remove and cleanup thread related functions and macros
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-02 07:26 UTC by Simon Feltman
Modified: 2017-03-22 08:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove and deprecate API for setting of thread blocking functions (11.67 KB, patch)
2013-05-03 08:54 UTC, Simon Feltman
committed Details | Review
Replace usage of pyg_begin_allow_threads with Py_BEGIN_ALLOW_THREADS (6.33 KB, patch)
2013-05-03 09:14 UTC, Simon Feltman
committed Details | Review
Remove support for building without threads (4.30 KB, patch)
2017-03-21 19:26 UTC, Christoph Reiter (lazka)
committed Details | Review
Remove pyglib_gil_state_ensure/pyglib_gil_state_release (24.21 KB, patch)
2017-03-21 19:27 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Simon Feltman 2013-05-02 07:26:56 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...
Comment 1 Simon Feltman 2013-05-03 08:54:16 UTC
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.
Comment 2 Simon Feltman 2013-05-03 09:14:22 UTC
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 3 Martin Pitt 2013-05-07 04:04:04 UTC
Comment on attachment 243151 [details] [review]
Remove and deprecate API for setting of thread blocking functions

Thanks!
Comment 4 Simon Feltman 2013-05-07 06:49:08 UTC
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 5 Simon Feltman 2013-05-07 06:50:59 UTC
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
Comment 6 Christoph Reiter (lazka) 2017-03-21 19:26:44 UTC
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.
Comment 7 Christoph Reiter (lazka) 2017-03-21 19:27:11 UTC
Created attachment 348440 [details] [review]
Remove pyglib_gil_state_ensure/pyglib_gil_state_release

Use PyGILState_Ensure/PyGILState_Release instead.
Comment 8 Simon Feltman 2017-03-22 07:26:26 UTC
Review of attachment 348439 [details] [review]:

Sure.
Comment 9 Simon Feltman 2017-03-22 07:28:12 UTC
Review of attachment 348440 [details] [review]:

Thanks.
Comment 10 Christoph Reiter (lazka) 2017-03-22 08:29:53 UTC
Thanks