Solaris >= 2.5.1 has POSIX threads.
* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document
--enable-threads=solaris any more.
(gl_THREADLIB_BODY): Don't set USE_SOLARIS_THREADS any more.
* lib/glthread/thread.c: Update comment.
* lib/glthread/thread.h: Remove code for USE_SOLARIS_THREADS.
* lib/glthread/lock.h: Likewise.
* lib/glthread/lock.c: Likewise.
* lib/glthread/cond.h: Likewise.
* lib/glthread/cond.c: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/glthread/tls.c: Likewise.
* lib/glthread/yield.h: Likewise.
* lib/regex_internal.h: Likewise.
* tests/test-thread_create.c: Likewise.
* tests/test-lock.c: Likewise.
* tests/test-cond.c: Likewise.
* tests/test-tls.c: Likewise.
+2019-07-05 Bruno Haible <bruno@clisp.org>
+
+ thread, lock, cond, tls: Remove support for old Solaris threads.
+ Solaris >= 2.5.1 has POSIX threads.
+ * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document
+ --enable-threads=solaris any more.
+ (gl_THREADLIB_BODY): Don't set USE_SOLARIS_THREADS any more.
+ * lib/glthread/thread.c: Update comment.
+ * lib/glthread/thread.h: Remove code for USE_SOLARIS_THREADS.
+ * lib/glthread/lock.h: Likewise.
+ * lib/glthread/lock.c: Likewise.
+ * lib/glthread/cond.h: Likewise.
+ * lib/glthread/cond.c: Likewise.
+ * lib/glthread/tls.h: Likewise.
+ * lib/glthread/tls.c: Likewise.
+ * lib/glthread/yield.h: Likewise.
+ * lib/regex_internal.h: Likewise.
+ * tests/test-thread_create.c: Likewise.
+ * tests/test-lock.c: Likewise.
+ * tests/test-cond.c: Likewise.
+ * tests/test-tls.c: Likewise.
+
2019-07-05 Bruno Haible <bruno@clisp.org>
getcwd-lgpl, getcwd: Don't call realloc when it is pointless.
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* -------------------------- gl_cond_t datatype -------------------------- */
-
-int
-glthread_cond_timedwait_multithreaded (gl_cond_t *cond,
- gl_lock_t *lock,
- struct timespec *abstime)
-{
- int ret;
-
- ret = cond_timedwait (cond, lock, abstime);
- if (ret == ETIME)
- return ETIMEDOUT;
- return ret;
-}
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
#endif
#include "glthread/lock.h"
#if !defined c11_threads_in_use
-# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK || USE_SOLARIS_THREADS_WEAK)
+# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK)
# include <threads.h>
# pragma weak thrd_exit
# define c11_threads_in_use() (thrd_exit != NULL)
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-# include <thread.h>
-# include <synch.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library. */
-
-# pragma weak cond_init
-# pragma weak cond_wait
-# pragma weak cond_timedwait
-# pragma weak cond_signal
-# pragma weak cond_broadcast
-# pragma weak cond_destroy
-# pragma weak thr_suspend
-# define thread_in_use() (thr_suspend != NULL || c11_threads_in_use ())
-
-# else
-
-# define thread_in_use() 1
-
-# endif
-
-/* -------------------------- gl_cond_t datatype -------------------------- */
-
-typedef cond_t gl_cond_t;
-# define gl_cond_define(STORAGECLASS, NAME) \
- STORAGECLASS gl_cond_t NAME;
-# define gl_cond_define_initialized(STORAGECLASS, NAME) \
- STORAGECLASS gl_cond_t NAME = gl_cond_initializer;
-# define gl_cond_initializer \
- DEFAULTCV
-# define glthread_cond_init(COND) \
- (pthread_in_use () ? cond_init (COND, USYNC_THREAD, NULL) : 0)
-# define glthread_cond_wait(COND, LOCK) \
- (pthread_in_use () ? cond_wait (COND, LOCK) : 0)
-# define glthread_cond_timedwait(COND, LOCK, ABSTIME) \
- (pthread_in_use () ? glthread_cond_timedwait_multithreaded (COND, LOCK, ABSTIME) : 0)
-# define glthread_cond_signal(COND) \
- (pthread_in_use () ? cond_signal (COND) : 0)
-# define glthread_cond_broadcast(COND) \
- (pthread_in_use () ? cond_broadcast (COND) : 0)
-# define glthread_cond_destroy(COND) \
- (pthread_in_use () ? cond_destroy (COND) : 0)
-extern int glthread_cond_timedwait_multithreaded (gl_cond_t *cond, gl_lock_t *lock, struct timespec *abstime);
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
- Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
- gthr-win32.h. */
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
#include <config.h>
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-int
-glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
-{
- int err;
-
- err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
- if (err != 0)
- return err;
- lock->owner = (thread_t) 0;
- lock->depth = 0;
- return 0;
-}
-
-int
-glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
-{
- thread_t self = thr_self ();
- if (lock->owner != self)
- {
- int err;
-
- err = mutex_lock (&lock->mutex);
- if (err != 0)
- return err;
- lock->owner = self;
- }
- if (++(lock->depth) == 0) /* wraparound? */
- {
- lock->depth--;
- return EAGAIN;
- }
- return 0;
-}
-
-int
-glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
-{
- if (lock->owner != thr_self ())
- return EPERM;
- if (lock->depth == 0)
- return EINVAL;
- if (--(lock->depth) == 0)
- {
- lock->owner = (thread_t) 0;
- return mutex_unlock (&lock->mutex);
- }
- else
- return 0;
-}
-
-int
-glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
-{
- if (lock->owner != (thread_t) 0)
- return EBUSY;
- return mutex_destroy (&lock->mutex);
-}
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-int
-glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
-{
- if (!once_control->inited)
- {
- int err;
-
- /* Use the mutex to guarantee that if another thread is already calling
- the initfunction, this thread waits until it's finished. */
- err = mutex_lock (&once_control->mutex);
- if (err != 0)
- return err;
- if (!once_control->inited)
- {
- once_control->inited = 1;
- initfunction ();
- }
- return mutex_unlock (&once_control->mutex);
- }
- else
- return 0;
-}
-
-int
-glthread_once_singlethreaded (gl_once_t *once_control)
-{
- /* We know that gl_once_t contains an integer type. */
- if (!once_control->inited)
- {
- /* First time use of once_control. Invert the marker. */
- once_control->inited = ~ 0;
- return 1;
- }
- else
- return 0;
-}
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
/* ------------------------- gl_rwlock_t datatype ------------------------- */
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
- Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
- gthr-win32.h. */
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
/* This file contains locking primitives for use with a given thread library.
It does not contain primitives for creating threads or for other
#include <stdlib.h>
#if !defined c11_threads_in_use
-# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK || USE_SOLARIS_THREADS_WEAK)
+# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK)
# include <threads.h>
# pragma weak thrd_exit
# define c11_threads_in_use() (thrd_exit != NULL)
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-# include <thread.h>
-# include <synch.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library. */
-
-# pragma weak mutex_init
-# pragma weak mutex_lock
-# pragma weak mutex_unlock
-# pragma weak mutex_destroy
-# pragma weak rwlock_init
-# pragma weak rw_rdlock
-# pragma weak rw_wrlock
-# pragma weak rw_unlock
-# pragma weak rwlock_destroy
-# pragma weak thr_self
-
-# pragma weak thr_suspend
-# define thread_in_use() (thr_suspend != NULL || c11_threads_in_use ())
-
-# else
-
-# define thread_in_use() 1
-
-# endif
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-typedef mutex_t gl_lock_t;
-# define gl_lock_define(STORAGECLASS, NAME) \
- STORAGECLASS mutex_t NAME;
-# define gl_lock_define_initialized(STORAGECLASS, NAME) \
- STORAGECLASS mutex_t NAME = gl_lock_initializer;
-# define gl_lock_initializer \
- DEFAULTMUTEX
-# define glthread_lock_init(LOCK) \
- (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
-# define glthread_lock_lock(LOCK) \
- (thread_in_use () ? mutex_lock (LOCK) : 0)
-# define glthread_lock_unlock(LOCK) \
- (thread_in_use () ? mutex_unlock (LOCK) : 0)
-# define glthread_lock_destroy(LOCK) \
- (thread_in_use () ? mutex_destroy (LOCK) : 0)
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-typedef rwlock_t gl_rwlock_t;
-# define gl_rwlock_define(STORAGECLASS, NAME) \
- STORAGECLASS rwlock_t NAME;
-# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
- STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
-# define gl_rwlock_initializer \
- DEFAULTRWLOCK
-# define glthread_rwlock_init(LOCK) \
- (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
-# define glthread_rwlock_rdlock(LOCK) \
- (thread_in_use () ? rw_rdlock (LOCK) : 0)
-# define glthread_rwlock_wrlock(LOCK) \
- (thread_in_use () ? rw_wrlock (LOCK) : 0)
-# define glthread_rwlock_unlock(LOCK) \
- (thread_in_use () ? rw_unlock (LOCK) : 0)
-# define glthread_rwlock_destroy(LOCK) \
- (thread_in_use () ? rwlock_destroy (LOCK) : 0)
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-/* Old Solaris threads did not have recursive locks.
- We have to implement them ourselves. */
-
-typedef struct
- {
- mutex_t mutex;
- thread_t owner;
- unsigned long depth;
- }
- gl_recursive_lock_t;
-# define gl_recursive_lock_define(STORAGECLASS, NAME) \
- STORAGECLASS gl_recursive_lock_t NAME;
-# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
- STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
-# define gl_recursive_lock_initializer \
- { DEFAULTMUTEX, (thread_t) 0, 0 }
-# define glthread_recursive_lock_init(LOCK) \
- (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_lock(LOCK) \
- (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_unlock(LOCK) \
- (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_destroy(LOCK) \
- (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
-extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef struct
- {
- volatile int inited;
- mutex_t mutex;
- }
- gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
- STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
- (thread_in_use () \
- ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
- : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
-extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
-extern int glthread_once_singlethreaded (gl_once_t *once_control);
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
- Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
- gthr-win32.h. */
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
#include <config.h>
along with this program; if not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
- Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
- gthr-win32.h. */
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
/* This file contains primitives for creating and controlling threads.
#include <stdlib.h>
#if !defined c11_threads_in_use
-# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK || USE_SOLARIS_THREADS_WEAK)
+# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK)
# include <threads.h>
# pragma weak thrd_exit
# define c11_threads_in_use() (thrd_exit != NULL)
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-# include <thread.h>
-# include <synch.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library. */
-
-# pragma weak thr_create
-# pragma weak thr_join
-# pragma weak thr_self
-# pragma weak thr_exit
-
-# pragma weak thr_suspend
-# define thread_in_use() (thr_suspend != NULL || c11_threads_in_use ())
-
-# else
-
-# define thread_in_use() 1
-
-# endif
-
-/* -------------------------- gl_thread_t datatype -------------------------- */
-
-typedef thread_t gl_thread_t;
-# define glthread_create(THREADP, FUNC, ARG) \
- (thread_in_use () ? thr_create (NULL, 0, FUNC, ARG, 0, THREADP) : 0)
-# define glthread_sigmask(HOW, SET, OSET) \
- (thread_in_use () ? sigprocmask (HOW, SET, OSET) : 0)
-# define glthread_join(THREAD, RETVALP) \
- (thread_in_use () ? thr_join (THREAD, NULL, RETVALP) : 0)
-# define gl_thread_self() \
- (thread_in_use () ? (void *) thr_self () : NULL)
-# define gl_thread_self_pointer() \
- gl_thread_self ()
-# define gl_thread_exit(RETVAL) \
- (thread_in_use () ? thr_exit (RETVAL) : 0)
-# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-/* ------------------------- gl_tls_key_t datatype ------------------------- */
-
-void *
-glthread_tls_get_multithreaded (thread_key_t key)
-{
- void *value;
-
- if (thr_getspecific (key, &value) != 0)
- abort ();
- return value;
-}
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
#endif
#include <stdlib.h>
#if !defined c11_threads_in_use
-# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK || USE_SOLARIS_THREADS_WEAK)
+# if HAVE_THREADS_H && (USE_POSIX_THREADS_WEAK || USE_PTH_THREADS_WEAK)
# include <threads.h>
# pragma weak thrd_exit
# define c11_threads_in_use() (thrd_exit != NULL)
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-# include <thread.h>
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library. */
-
-# pragma weak thr_keycreate
-# pragma weak thr_getspecific
-# pragma weak thr_setspecific
-
-# pragma weak thr_suspend
-# define thread_in_use() (thr_suspend != NULL || c11_threads_in_use ())
-
-# else
-
-# define thread_in_use() 1
-
-# endif
-
-/* ------------------------- gl_tls_key_t datatype ------------------------- */
-
-typedef union
- {
- void *singlethread_value;
- thread_key_t key;
- }
- gl_tls_key_t;
-# define glthread_tls_key_init(KEY, DESTRUCTOR) \
- (thread_in_use () \
- ? thr_keycreate (&(KEY)->key, DESTRUCTOR) \
- : ((KEY)->singlethread_value = NULL, 0))
-# define gl_tls_get(NAME) \
- (thread_in_use () \
- ? glthread_tls_get_multithreaded ((NAME).key) \
- : (NAME).singlethread_value)
-extern void *glthread_tls_get_multithreaded (thread_key_t key);
-# define glthread_tls_set(KEY, POINTER) \
- (thread_in_use () \
- ? thr_setspecific ((KEY)->key, (POINTER)) \
- : ((KEY)->singlethread_value = (POINTER), 0))
-# define glthread_tls_key_destroy(KEY) \
- /* Unsupported. */ \
- 0
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
/* ========================================================================= */
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library. */
-
-# include <thread.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# define gl_thread_yield() \
- thr_yield ()
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
#if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
# define lock_define(name) pthread_mutex_t name;
# elif USE_PTH_THREADS
# define lock_define(name) pth_mutex_t name;
-# elif USE_SOLARIS_THREADS
-# define lock_define(name) mutex_t name;
# elif USE_WINDOWS_THREADS
# define lock_define(name) gl_lock_t name;
# else
-# threadlib.m4 serial 18
+# threadlib.m4 serial 19
dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl default is 'no', otherwise it is system dependent. In both cases, the user
dnl can change the choice through the options --enable-threads=choice or
dnl --disable-threads.
-dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
-dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
+dnl Defines at most one of the macros USE_POSIX_THREADS, USE_PTH_THREADS,
+dnl USE_WINDOWS_THREADS.
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
dnl libtool).
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
AC_ARG_ENABLE([threads],
-AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AC_HELP_STRING([--enable-threads={posix|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
[gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then
fi
fi
fi
- if test -z "$gl_have_pthread"; then
- if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
- gl_have_solaristhread=
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lthread"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <thread.h>
-#include <synch.h>
- ]],
- [[thr_self();]])],
- [gl_have_solaristhread=yes])
- LIBS="$gl_save_LIBS"
- if test -n "$gl_have_solaristhread"; then
- gl_threads_api=solaris
- LIBTHREAD=-lthread
- LTLIBTHREAD=-lthread
- LIBMULTITHREAD="$LIBTHREAD"
- LTLIBMULTITHREAD="$LTLIBTHREAD"
- AC_DEFINE([USE_SOLARIS_THREADS], [1],
- [Define if the old Solaris multithreading library can be used.])
- if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
- AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
- [Define if references to the old Solaris multithreading library should be made weak.])
- LIBTHREAD=
- LTLIBTHREAD=
- fi
- fi
- fi
- fi
if test "$gl_use_threads" = pth; then
gl_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_LINKFLAGS([pth])
dnl Mac OS X 10.[123] posix -lpthread Y OK
dnl
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
-dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
dnl
dnl HP-UX 11 posix -lpthread N (cc) OK
dnl Y (gcc)
#include <config.h>
-#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
+#if USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
/* Which tests to perform.
Uncomment some of these, to verify that all tests crash if no locking
#include <config.h>
-#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
+#if USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
#if USE_POSIX_THREADS
# define TEST_POSIX_THREADS 1
#endif
-#if USE_SOLARIS_THREADS
-# define TEST_SOLARIS_THREADS 1
-#endif
#if USE_PTH_THREADS
# define TEST_PTH_THREADS 1
#endif
#if !ENABLE_LOCKING
# undef USE_POSIX_THREADS
-# undef USE_SOLARIS_THREADS
# undef USE_PTH_THREADS
# undef USE_WINDOWS_THREADS
#endif
# if TEST_POSIX_THREADS
# define USE_POSIX_THREADS 1
# endif
-# if TEST_SOLARIS_THREADS
-# define USE_SOLARIS_THREADS 1
-# endif
# if TEST_PTH_THREADS
# define USE_PTH_THREADS 1
# endif
}
else
{
-#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
+#if USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
fputs ("glthread_create failed\n", stderr);
return 1;
#else
#include <config.h>
-#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
+#if USE_POSIX_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS
#if USE_POSIX_THREADS
# define TEST_POSIX_THREADS 1
#endif
-#if USE_SOLARIS_THREADS
-# define TEST_SOLARIS_THREADS 1
-#endif
#if USE_PTH_THREADS
# define TEST_PTH_THREADS 1
#endif