/* 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
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);
{
/* 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,