The old Solaris threads facility was needed for portability to the ancient Solaris 2.4. Solaris >= 2.5.1 has POSIX threads. Even though Solaris nowadays probably still supports this API, you can bet that 100% of all applications use the POSIX threads API. There is no point in --enable-threads=solaris any more.
Since this code is in the way of unifying the thread, lock, cond, tls modules with the 'pthread' module, I'm removing it. 2019-07-05 Bruno Haible <br...@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. diff --git a/lib/glthread/cond.c b/lib/glthread/cond.c index 2285c16..72aeca4 100644 --- a/lib/glthread/cond.c +++ b/lib/glthread/cond.c @@ -52,27 +52,6 @@ glthread_cond_timedwait_multithreaded (gl_cond_t *cond, /* ========================================================================= */ -#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 diff --git a/lib/glthread/cond.h b/lib/glthread/cond.h index 8880b07..b03ffe3 100644 --- a/lib/glthread/cond.h +++ b/lib/glthread/cond.h @@ -56,7 +56,7 @@ #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) @@ -227,67 +227,6 @@ extern int glthread_cond_timedwait_multithreaded (gl_cond_t *cond, gl_lock_t *lo /* ========================================================================= */ -#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 */ @@ -334,7 +273,7 @@ typedef glwthread_cond_t gl_cond_t; /* ========================================================================= */ -#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. */ diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c index a686a30..e7fa3f8 100644 --- a/lib/glthread/lock.c +++ b/lib/glthread/lock.c @@ -15,8 +15,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <br...@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> @@ -680,117 +679,6 @@ glthread_once_singlethreaded (pth_once_t *once_control) /* ========================================================================= */ -#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 ------------------------- */ diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index fb1ebc6..2db8b7e 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -15,8 +15,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <br...@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 @@ -82,7 +81,7 @@ #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) @@ -556,135 +555,6 @@ extern int glthread_once_singlethreaded (pth_once_t *once_control); /* ========================================================================= */ -#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 */ @@ -807,7 +677,7 @@ typedef glwthread_once_t gl_once_t; /* ========================================================================= */ -#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. */ diff --git a/lib/glthread/thread.c b/lib/glthread/thread.c index 9da0542..776bfb6 100644 --- a/lib/glthread/thread.c +++ b/lib/glthread/thread.c @@ -15,8 +15,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <br...@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> diff --git a/lib/glthread/thread.h b/lib/glthread/thread.h index bf4e74a..eed2eb6 100644 --- a/lib/glthread/thread.h +++ b/lib/glthread/thread.h @@ -15,8 +15,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <br...@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. @@ -75,7 +74,7 @@ #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) @@ -277,60 +276,6 @@ typedef pth_t gl_thread_t; /* ========================================================================= */ -#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 */ @@ -367,7 +312,7 @@ typedef glwthread_thread_t gl_thread_t; /* ========================================================================= */ -#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. */ diff --git a/lib/glthread/tls.c b/lib/glthread/tls.c index 7a3e109..cc6d4e1 100644 --- a/lib/glthread/tls.c +++ b/lib/glthread/tls.c @@ -34,26 +34,6 @@ /* ========================================================================= */ -#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 diff --git a/lib/glthread/tls.h b/lib/glthread/tls.h index 6c67de8..a86dcd4 100644 --- a/lib/glthread/tls.h +++ b/lib/glthread/tls.h @@ -47,7 +47,7 @@ #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) @@ -179,58 +179,6 @@ typedef union /* ========================================================================= */ -#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 */ @@ -254,7 +202,7 @@ typedef glwthread_tls_key_t gl_tls_key_t; /* ========================================================================= */ -#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. */ diff --git a/lib/glthread/yield.h b/lib/glthread/yield.h index e139b98..3a2877b 100644 --- a/lib/glthread/yield.h +++ b/lib/glthread/yield.h @@ -67,27 +67,6 @@ extern "C" { /* ========================================================================= */ -#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 */ @@ -108,7 +87,7 @@ extern "C" { /* ========================================================================= */ -#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. */ diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 5462419..16e18ca 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -53,8 +53,6 @@ # 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 diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index ca7bc47..74b95b6 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -1,4 +1,4 @@ -# 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, @@ -16,8 +16,8 @@ dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the 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). @@ -52,7 +52,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [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 @@ -250,37 +250,6 @@ int main () 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]) @@ -394,7 +363,6 @@ dnl 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) diff --git a/tests/test-cond.c b/tests/test-cond.c index 1de6783..d8f76c6 100644 --- a/tests/test-cond.c +++ b/tests/test-cond.c @@ -16,7 +16,7 @@ #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 diff --git a/tests/test-lock.c b/tests/test-lock.c index ca7dd62..e3b4ce9 100644 --- a/tests/test-lock.c +++ b/tests/test-lock.c @@ -18,14 +18,11 @@ #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 @@ -90,7 +87,6 @@ #if !ENABLE_LOCKING # undef USE_POSIX_THREADS -# undef USE_SOLARIS_THREADS # undef USE_PTH_THREADS # undef USE_WINDOWS_THREADS #endif @@ -100,9 +96,6 @@ # 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 diff --git a/tests/test-thread_create.c b/tests/test-thread_create.c index f45edff..fbfc561 100644 --- a/tests/test-thread_create.c +++ b/tests/test-thread_create.c @@ -67,7 +67,7 @@ main () } 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 diff --git a/tests/test-tls.c b/tests/test-tls.c index 2ce9f0d..302ca18 100644 --- a/tests/test-tls.c +++ b/tests/test-tls.c @@ -18,14 +18,11 @@ #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