diff options
author | Christoph Reiter <creiter@src.gnome.org> | 2017-03-21 20:05:08 +0100 |
---|---|---|
committer | Christoph Reiter <creiter@src.gnome.org> | 2017-03-22 09:27:41 +0100 |
commit | 16e187636d186d4c128288efb032c5ddd69569b3 (patch) | |
tree | 89d50d44e3bc9b35b5db5b2d13feb182fa866f53 | |
parent | 20220d5eac510e3445a96e4e9061fd1bc6ec37c7 (diff) | |
download | pygobject-16e187636d186d4c128288efb032c5ddd69569b3.tar.gz |
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.
https://bugzilla.gnome.org/show_bug.cgi?id=699440
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | gi/gobjectmodule.c | 7 | ||||
-rw-r--r-- | gi/pyglib.h | 9 | ||||
-rw-r--r-- | gi/pygobject.h | 19 |
4 files changed, 8 insertions, 51 deletions
diff --git a/configure.ac b/configure.ac index b9358eaf..a28f75ec 100644 --- a/configure.ac +++ b/configure.ac @@ -134,29 +134,6 @@ CPPFLAGS=$old_CPPFLAGS PLATFORM=`$PYTHON -c "import sys; from distutils import util; sys.stdout.write(util.get_platform())"` AC_SUBST(PLATFORM) -AC_ARG_ENABLE(thread, - AS_HELP_STRING([--disable-thread],[Disable pygobject threading support]),, - enable_thread=yes) - -PYG_CHECK_PYMOD(thread,,,enable_thread=check_for_py3_module) -if test "x$enable_thread" = xcheck_for_py3_module; then - dnl Python 3 uses the _thread module so check for that - PYG_CHECK_PYMOD(_thread,,enable_thread=yes,enable_thread=no) -fi - -AC_MSG_CHECKING(whether to enable threading in pygobject) -if test "x$enable_thread" != xno; then - extra_mods=gthread - THREADING_CFLAGS= - AC_MSG_RESULT(yes) -else - extra_mods= - THREADING_CFLAGS="-DDISABLE_THREADING" - AC_MSG_RESULT(no) -fi -AC_SUBST(THREADING_CFLAGS) -CPPFLAGS="${CPPFLAGS} $THREADING_CFLAGS" - dnl get rid of the -export-dynamic stuff from the configure flags ... export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh` @@ -247,7 +224,6 @@ AC_MSG_RESULT([ Is release: $ax_is_release Using python interpreter: $PYTHON cairo support: $enable_cairo - thread support: $enable_thread code coverage support: $enable_code_coverage ]) diff --git a/gi/gobjectmodule.c b/gi/gobjectmodule.c index 1debcb6d..37d3d411 100644 --- a/gi/gobjectmodule.c +++ b/gi/gobjectmodule.c @@ -1893,12 +1893,7 @@ struct _PyGObject_Functions pygobject_api_functions = { pyg_flags_add, pyg_flags_from_gtype, - /* threads_enabled */ -#ifdef DISABLE_THREADING - FALSE, -#else - TRUE, -#endif + TRUE, /* threads_enabled */ pygobject_enable_threads, pygobject_gil_state_ensure, diff --git a/gi/pyglib.h b/gi/pyglib.h index 37bdfa52..b5e723a8 100644 --- a/gi/pyglib.h +++ b/gi/pyglib.h @@ -31,13 +31,8 @@ G_BEGIN_DECLS typedef void (*PyGLibThreadsEnabledFunc) (void); typedef void (*PyGLibThreadBlockFunc) (void); -#ifdef DISABLE_THREADING -# define pyglib_gil_state_ensure() PyGILState_LOCKED -# define pyglib_gil_state_release(state) state -#else -# define pyglib_gil_state_ensure PyGILState_Ensure -# define pyglib_gil_state_release PyGILState_Release -#endif +#define pyglib_gil_state_ensure PyGILState_Ensure +#define pyglib_gil_state_release PyGILState_Release GOptionGroup * pyglib_option_group_transfer_group(PyObject *self); diff --git a/gi/pygobject.h b/gi/pygobject.h index 9e45dde3..37624292 100644 --- a/gi/pygobject.h +++ b/gi/pygobject.h @@ -208,21 +208,12 @@ struct _PyGObject_Functions { }; -#ifdef DISABLE_THREADING -# define pyg_threads_enabled FALSE -# define pyg_gil_state_ensure() 0 -# define pyg_gil_state_release(state) -# define pyg_begin_allow_threads G_STMT_START { -# define pyg_end_allow_threads } G_STMT_END -#else -# define pyg_threads_enabled TRUE -# define pyg_gil_state_ensure PyGILState_Ensure -# define pyg_gil_state_release PyGILState_Release -# define pyg_begin_allow_threads Py_BEGIN_ALLOW_THREADS -# define pyg_end_allow_threads Py_END_ALLOW_THREADS -#endif - /* Deprecated, only available for API compatibility. */ +#define pyg_threads_enabled TRUE +#define pyg_gil_state_ensure PyGILState_Ensure +#define pyg_gil_state_release PyGILState_Release +#define pyg_begin_allow_threads Py_BEGIN_ALLOW_THREADS +#define pyg_end_allow_threads Py_END_ALLOW_THREADS #define pyg_enable_threads() #define pyg_set_thread_block_funcs(a, b) #define pyg_block_threads() |