emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 d8b4105: Remove attempt to use C11 threads


From: Paul Eggert
Subject: [Emacs-diffs] emacs-25 d8b4105: Remove attempt to use C11 threads
Date: Wed, 16 Dec 2015 07:10:52 +0000

branch: emacs-25
commit d8b41057051896541798647e90421daf0b38ed1c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Remove attempt to use C11 threads
    
    C11 threads are not needed for Emacs now, and their use is causing
    hassles on FreeBSD 10.x.  Problem reported by Ashish SHUKLA in:
    http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00648.html
    * configure.ac: Do not check for C11 threads. Remove unnecessary
    fiddling with CPPFLAGS when configuring pthreads.
    * src/emacs-module.c (main_thread, check_main_thread)
    (module_init): Do not worry about C11 threads.
---
 configure.ac       |    7 +------
 src/emacs-module.c |   13 +++----------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index b2fa1ed..14a1428 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2192,9 +2192,6 @@ LIBS="$LIBS_SYSTEM $LIBS"
 dnl FIXME replace main with a function we actually want from this library.
 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
 
-dnl Check for C11 threads.
-AC_CHECK_HEADERS_ONCE(threads.h)
-
 dnl Check for the POSIX thread library.
 LIB_PTHREAD=
 AC_CHECK_HEADERS_ONCE(pthread.h)
@@ -2202,7 +2199,6 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != 
"mingw32"; then
   AC_CACHE_CHECK([for pthread library],
     [emacs_cv_pthread_lib],
     [emacs_cv_pthread_lib=no
-     OLD_CPPFLAGS=$CPPFLAGS
      OLD_LIBS=$LIBS
      for emacs_pthread_lib in 'none needed' -lpthread; do
        case $emacs_pthread_lib in
@@ -2231,8 +2227,7 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != 
"mingw32"; then
        if test "$emacs_cv_pthread_lib" != no; then
         break
        fi
-     done
-     CPPFLAGS=$OLD_CPPFLAGS])
+     done])
   if test "$emacs_cv_pthread_lib" != no; then
     AC_DEFINE([HAVE_PTHREAD], 1, [Define to 1 if you have POSIX threads.])
     case $emacs_cv_pthread_lib in
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 620df93..ee97644 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -44,10 +44,7 @@ enum { module_has_cleanup = false };
 
 /* Handle to the main thread.  Used to verify that modules call us in
    the right thread.  */
-#ifdef HAVE_THREADS_H
-# include <threads.h>
-static thrd_t main_thread;
-#elif defined HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
 # include <pthread.h>
 static pthread_t main_thread;
 #elif defined WINDOWSNT
@@ -789,9 +786,7 @@ usage: (module-call ENVOBJ &rest ARGLIST)   */)
 static void
 check_main_thread (void)
 {
-#ifdef HAVE_THREADS_H
-  eassert (thrd_equal (thdr_current (), main_thread));
-#elif defined HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
   eassert (pthread_equal (pthread_self (), main_thread));
 #elif defined WINDOWSNT
   eassert (GetCurrentThreadId () == main_thread);
@@ -1125,9 +1120,7 @@ module_init (void)
 {
   /* It is not guaranteed that dynamic initializers run in the main thread,
      therefore detect the main thread here.  */
-#ifdef HAVE_THREADS_H
-  main_thread = thrd_current ();
-#elif defined HAVE_PTHREAD
+#ifdef HAVE_PTHREAD
   main_thread = pthread_self ();
 #elif defined WINDOWSNT
   /* The 'main' function already recorded the main thread's thread ID,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]