aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2015-12-15 23:10:12 -0800
committerPaul Eggert2015-12-15 23:10:48 -0800
commitd8b41057051896541798647e90421daf0b38ed1c (patch)
treed4d533b3e3aa62b95961f0379769e0d6b1019e44 /src
parent80346f1ae4b3d56490e4a744df2bf1db00844ddc (diff)
downloademacs-d8b41057051896541798647e90421daf0b38ed1c.tar.gz
emacs-d8b41057051896541798647e90421daf0b38ed1c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/emacs-module.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 620df930a44..ee976440985 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -44,10 +44,7 @@ enum { module_has_cleanup = false };
44 44
45/* Handle to the main thread. Used to verify that modules call us in 45/* Handle to the main thread. Used to verify that modules call us in
46 the right thread. */ 46 the right thread. */
47#ifdef HAVE_THREADS_H 47#ifdef HAVE_PTHREAD
48# include <threads.h>
49static thrd_t main_thread;
50#elif defined HAVE_PTHREAD
51# include <pthread.h> 48# include <pthread.h>
52static pthread_t main_thread; 49static pthread_t main_thread;
53#elif defined WINDOWSNT 50#elif defined WINDOWSNT
@@ -789,9 +786,7 @@ usage: (module-call ENVOBJ &rest ARGLIST) */)
789static void 786static void
790check_main_thread (void) 787check_main_thread (void)
791{ 788{
792#ifdef HAVE_THREADS_H 789#ifdef HAVE_PTHREAD
793 eassert (thrd_equal (thdr_current (), main_thread));
794#elif defined HAVE_PTHREAD
795 eassert (pthread_equal (pthread_self (), main_thread)); 790 eassert (pthread_equal (pthread_self (), main_thread));
796#elif defined WINDOWSNT 791#elif defined WINDOWSNT
797 eassert (GetCurrentThreadId () == main_thread); 792 eassert (GetCurrentThreadId () == main_thread);
@@ -1125,9 +1120,7 @@ module_init (void)
1125{ 1120{
1126 /* It is not guaranteed that dynamic initializers run in the main thread, 1121 /* It is not guaranteed that dynamic initializers run in the main thread,
1127 therefore detect the main thread here. */ 1122 therefore detect the main thread here. */
1128#ifdef HAVE_THREADS_H 1123#ifdef HAVE_PTHREAD
1129 main_thread = thrd_current ();
1130#elif defined HAVE_PTHREAD
1131 main_thread = pthread_self (); 1124 main_thread = pthread_self ();
1132#elif defined WINDOWSNT 1125#elif defined WINDOWSNT
1133 /* The 'main' function already recorded the main thread's thread ID, 1126 /* The 'main' function already recorded the main thread's thread ID,