[pygobject] Remove support for building without threads



commit 16e187636d186d4c128288efb032c5ddd69569b3
Author: Christoph Reiter <creiter src gnome org>
Date:   Tue Mar 21 20:05:08 2017 +0100

    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

 configure.ac       |   24 ------------------------
 gi/gobjectmodule.c |    7 +------
 gi/pyglib.h        |    9 ++-------
 gi/pygobject.h     |   19 +++++--------------
 4 files changed, 8 insertions(+), 51 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b9358ea..a28f75e 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 1debcb6..37d3d41 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 37bdfa5..b5e723a 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 9e45dde..3762429 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()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]