| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggested by Florian Weimer <fweimer@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00211.html>.
* m4/threadlib.m4 (gl_PTHREADLIB_BODY): Set gl_pthread_in_glibc and set
LIBPMULTITHREAD accordingly.
(gl_STDTHREADLIB_BODY): Update comments.
(gl_THREADLIB_BODY): Define USE_POSIX_THREADS_FROM_LIBC.
* lib/glthread/thread.h (c11_threads_in_use): Define to 1 if all POSIX
thread functions are in libc.
* lib/glthread/lock.h (c11_threads_in_use): Likewise.
* lib/glthread/cond.h (c11_threads_in_use): Likewise.
* lib/glthread/tls.h (c11_threads_in_use): Likewise.
|
|
|
|
|
|
|
| |
* lib/glthread/thread.c (gl_thread_create): Moved to here...
* lib/glthread/thread.h (gl_thread_create): ...from here.
(_GLTHREAD_THREAD_INLINE): Remove macro.
Remove _GL_INLINE_HEADER_BEGIN/END invocations.
|
|
|
|
|
| |
* lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description
says so.
|
| |
|
|
|
|
|
|
|
|
| |
* m4/threadlib.m4 (gl_THREADLIB_BODY): When weak symbols are not present
on FreeBSD, define PTHREAD_IN_USE_DETECTION_HARD.
* lib/glthread/threadlib.c: Include <errno.h>.
(glthread_in_use): For FreeBSD, provide an alternative implementation
that uses pthread_key_create.
|
|
|
|
|
|
|
| |
Problem reported by Kiyoshi KANAZAWA for grep (Bug#43666#29).
* lib/glthread/thread.h (gl_thread_self): Use ‘(pthread_t) 0’
instead of ‘(pthread_t) NULL’, to pacify GCC on Solaris 10
where pthread_t is unsigned int.
|
|
|
|
| |
* lib/glthread/thread.h (gl_thread_exit): Add a cast to void.
|
|
|
|
|
|
| |
* lib/glthread/lock.c (glthread_once_multithreaded): New function.
* lib/glthread/lock.h (glthread_once_multithreaded): New declaration.
(glthread_once): Use it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00001.html>
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00167.html>
* lib/pthread.in.h (PTHREAD_RWLOCK_INITIALIZER): Define to
PTHREAD_RWLOCK_INITIALIZER_NP when possible.
* lib/glthread/lock.h: Allow PTHREAD_RWLOCK_INITIALIZER_NP as an
alternative to PTHREAD_RWLOCK_INITIALIZER.
* lib/glthread/lock.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Accept the options
--enable-threads=isoc and --enable-threads=isoc+posix.
(gl_THREADLIB_BODY): Test whether the ISO C threads API is available.
When both the ISO C and the POSIX threads API are available, choose
USE_ISOC_AND_POSIX_THREADS instead of USE_POSIX_THREADS if
--enable-threads=isoc+posix was specified. When only the ISO C threads
API is available and --enable-threads=iso was specified, choose
USE_ISOC_THREADS.
* lib/glthread/lock.h: Add new code for USE_ISOC_THREADS ||
USE_ISOC_AND_POSIX_THREADS.
* 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/glthread/thread.h: Add new code for USE_ISOC_THREADS. Treat
USE_ISOC_AND_POSIX_THREADS like USE_POSIX_THREADS.
* lib/glthread/thread.c: Likewise.
* lib/glthread/threadlib.c: Likewise.
* tests/test-lock.c: Save and restore the values of USE_ISOC_THREADS and
USE_ISOC_AND_POSIX_THREADS.
* tests/test-cond.c: Consider USE_ISOC_THREADS and
USE_ISOC_AND_POSIX_THREADS.
* tests/test-tls.c: Likewise.
* tests/test-thread_create.c (main): Likewise.
* tests/test-pthread-cond.c: Likewise.
* tests/test-pthread-mutex.c: Likewise.
* tests/test-pthread-once2.c: Likewise.
* tests/test-pthread-rwlock.c: Likewise.
* tests/test-pthread-tss.c: Likewise.
* tests/test-pthread_sigmask2.c: Treat USE_ISOC_AND_POSIX_THREADS like
USE_POSIX_THREADS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-rwlock.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-rwlock.c: New file, extracted from lib/glthread/lock.c.
* lib/glthread/lock.h: Include windows-rwlock.h. Don't include
windows-initguard.h.
(gl_rwlock_t): Define using glwthread_rwlock_t.
(gl_rwlock_initializer): Define using GLWTHREAD_RWLOCK_INIT.
(glthread_rwlock_init): Define using glwthread_rwlock_init.
(glthread_rwlock_rdlock): Define using glwthread_rwlock_rdlock.
(glthread_rwlock_wrlock): Define using glwthread_rwlock_wrlock.
(glthread_rwlock_unlock): Define using glwthread_rwlock_unlock.
(glthread_rwlock_destroy): Define using glwthread_rwlock_destroy.
(glthread_rwlock_init_func, glthread_rwlock_rdlock_func,
glthread_rwlock_wrlock_func, glthread_rwlock_unlock_func,
glthread_rwlock_destroy_func): Remove declarations.
* lib/glthread/lock.c (gl_waitqueue_t): Remove type.
(gl_waitqueue_init, gl_waitqueue_add, gl_waitqueue_notify_first,
gl_waitqueue_notify_all, glthread_rwlock_init_func,
glthread_rwlock_rdlock_func, glthread_rwlock_wrlock_func,
glthread_rwlock_unlock_func, glthread_rwlock_destroy_func): Remove
functions.
* modules/windows-rwlock: New file.
* modules/lock (Depends-on): Add windows-rwlock.
|
|
|
|
|
|
|
|
| |
* lib/windows-thread.h (GLWTHREAD_ATTR_DETACHED): New macro.
(glwthread_thread_create): Add attr argument.
* lib/windows-thread.c (glwthread_thread_create): Likewise.
* lib/glthread/thread.h (glthread_create): Update.
* lib/thrd.c (thrd_create): Update.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-initguard.h: Renamed from lib/windows-spinlock.h.
(glwthread_initguard_t): Renamed from glwthread_spinlock_t.
(GLWTHREAD_INITGUARD_INIT): Renamed from GLWTHREAD_SPINLOCK_INIT.
* lib/windows-mutex.h: Update.
* lib/windows-recmutex.h: Likewise.
* lib/windows-timedmutex.h: Likewise.
* lib/windows-timedrecmutex.h: Likewise.
* lib/windows-cond.h: Likewise.
* lib/glthread/lock.h: Likewise.
* modules/windows-mutex (Files): Add lib/windows-initguard.h. Remove
lib/windows-spinlock.h.
* modules/windows-recmutex (Files): Likewise.
* modules/windows-timedmutex (Files): Likewise.
* modules/windows-timedrecmutex (Files): Likewise.
* modules/windows-cond (Files): Likewise.
* modules/threads-h (Files): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Don't document
--enable-threads=pth any more.
(gl_THREADLIB_BODY): Don't set USE_PTH_THREADS any more.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Update comment.
* m4/threads.m4 (gl_THREADS_H): Remove test for conflict between Pth
threads and ISO C11 threads.
* lib/glthread/thread.h: Remove code for USE_PTH_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.
* tests/test-rwlock1.c: Don't include glthread/yield.h.
(main): Sleep without calling gl_thread_yield.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-tls.h (glwthread_tls_process_destructors): New
declaration.
(GLWTHREAD_DESTRUCTOR_ITERATIONS): New macro.
* lib/windows-tls.c: Include <limits.h>, windows-once.h.
(dtor_table_init_once, dtor_table_lock: New variables.
(struct dtor): New type.
(dtor_table, dtors_count, dtors_used, dtors_allocated,
dtor_processing_threads): New variables.
(dtor_table_initialize, dtor_table_ensure_initialized,
dtor_table_shrink_used, glwthread_tls_process_destructors): New
functions.
(glwthread_tls_key_create, glwthread_tls_key_delete): Rewritten to
handle non-NULL destructors.
* modules/windows-tls (Depends-on): Add windows-once.
* lib/glthread/tls.h (glthread_tls_key_init, glthread_tls_key_destroy):
Use the functions declared in windows-tls.h.
* lib/threads.in.h (TSS_DTOR_ITERATIONS): Define using
GLWTHREAD_DESTRUCTOR_ITERATIONS.
* lib/windows-thread.c: Include windows-tls.h.
(wrapper_func, glwthread_thread_exit): Invoke
glwthread_tls_process_destructors.
* modules/windows-thread (Depends-on): Add windows-tls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-thread.h: New file, based on lib/glthread/thread.h.
* lib/windows-thread.c: New file, based on lib/glthread/thread.c.
* lib/glthread/thread.h: Include windows-thread.h.
(gl_thread_t): Define using glwthread_thread_t.
(glthread_create): Define using glwthread_thread_create.
(glthread_join): Define using glwthread_thread_join.
(gl_thread_self): Define using glwthread_thread_self.
(gl_thread_exit): Define using glwthread_thread_exit.
(glthread_create_func, glthread_join_func, gl_thread_self_func,
gl_thread_exit_func): Remove declarations.
* lib/glthread/thread.c (self_key): Remove variable.
(do_init_self_key, init_self_key): Remove functions.
(struct gl_thread_struct): Remove type.
(get_current_thread_handle, gl_thread_self_func, wrapper_func,
glthread_create_func, glthread_join_func, gl_thread_exit_func): Remove
functions.
* modules/windows-thread: New file.
* modules/thread (Depends-on): Add windows-thread.
|
|
|
|
|
|
|
|
|
| |
* lib/windows-tls.h: New file, based on lib/glthread/tls.h.
* lib/windows-tls.c: New file, based on lib/glthread/tls.h.
* lib/glthread/tls.h: Include windows-tls.h.
(gl_tls_key_t): Define using glwthread_tls_key_t.
* modules/windows-tls: New file.
* modules/tls (Depends-on): Add windows-tls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-cond.h: New file, based on lib/glthread/cond.h.
* lib/windows-cond.c: New file, based on lib/glthread/cond.c.
* lib/glthread/cond.h: Include windows-cond.h.
(struct gl_waitqueue_link, gl_linked_waitqueue_t): Remove types.
(gl_cond_t): Define using glwthread_cond_t.
(gl_cond_initializer): Define using GLWTHREAD_COND_INIT.
(glthread_cond_init): Define using glwthread_cond_init.
(glthread_cond_wait): Define using glwthread_cond_wait.
(glthread_cond_timedwait): Define using glwthread_cond_timedwait.
(glthread_cond_signal): Define using glwthread_cond_signal.
(glthread_cond_broadcast): Define using glwthread_cond_broadcast.
(glthread_cond_destroy): Define using glwthread_cond_destroy.
(glthread_cond_init_func, glthread_cond_wait_func,
glthread_cond_timedwait_func, glthread_cond_signal_func,
glthread_cond_broadcast_func, glthread_cond_destroy_func): Remove
declarations.
* lib/glthread/cond.c (gl_waitqueue_t, gl_waitqueue_element): Remove
types.
(gl_waitqueue_init, gl_waitqueue_add, gl_waitqueue_remove,
gl_waitqueue_notify_first, gl_waitqueue_notify_all,
glthread_cond_init_func, glthread_cond_wait_func,
glthread_cond_timedwait_func, glthread_cond_signal_func,
glthread_cond_broadcast_func, glthread_cond_destroy_func): Remove
functions.
* modules/windows-cond: New file.
* modules/cond (Depends-on): Add windows-cond. Remove gettimeofday.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-recmutex.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-recmutex.c: New file, extracted from lib/glthread/lock.c.
* lib/glthread/lock.h: Include windows-recmutex.h.
(gl_recursive_lock_t): Define using glwthread_recmutex_t.
(gl_recursive_lock_initializer): Define using GLWTHREAD_RECMUTEX_INIT.
(glthread_recursive_lock_init): Define using glwthread_recmutex_init.
(glthread_recursive_lock_lock): Define using glwthread_recmutex_lock.
(glthread_recursive_lock_unlock): Define using
glwthread_recmutex_unlock.
(glthread_recursive_lock_destroy): Define using
glwthread_recmutex_destroy.
(glthread_recursive_lock_init_func, glthread_recursive_lock_lock_func,
glthread_recursive_lock_unlock_func,
glthread_recursive_lock_destroy_func): Remove declarations.
* lib/glthread/lock.c (glthread_recursive_lock_init_func,
glthread_recursive_lock_lock_func, glthread_recursive_lock_unlock_func,
glthread_recursive_lock_destroy_func): Remove functions.
* modules/windows-recmutex: New file.
* modules/lock (Depends-on): Add windows-recmutex.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-mutex.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-mutex.c: New file, extracted from lib/glthread/lock.c.
* lib/windows-spinlock.h: New file, extracted from lib/glthread/lock.h.
* lib/glthread/lock.h: Include windows-spinlock.h, windows-mutex.h.
(gl_spinlock_t): Remove type.
(gl_lock_t): Define using glwthread_mutex_t.
(gl_lock_initializer): Define using GLWTHREAD_MUTEX_INIT.
(glthread_lock_init): Define using glwthread_mutex_init.
(glthread_lock_lock): Define using glwthread_mutex_lock.
(glthread_lock_unlock): Define using glwthread_mutex_unlock.
(glthread_lock_destroy): Define using glwthread_mutex_destroy.
(glthread_lock_init_func, glthread_lock_lock_func,
glthread_lock_unlock_func, glthread_lock_destroy_func): Remove
declarations.
Use glwthread_spinlock_t instead of gl_spinlock_t.
(gl_rwlock_initializer, gl_recursive_lock_initializer): Define using
GLWTHREAD_SPINLOCK_INIT.
* lib/glthread/lock.c (glthread_lock_init_func, glthread_lock_lock_func,
glthread_lock_unlock_func, glthread_lock_destroy_func): Remove
functions.
* lib/glthread/cond.h: Use glwthread_spinlock_t instead of
gl_spinlock_t.
* modules/windows-mutex: New file.
* modules/lock (Depends-on): Add windows-mutex.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/windows-once.h: New file, extracted from lib/glthread/lock.h.
* lib/windows-once.c: New file, extracted from lib/glthread/lock.c.
* lib/glthread/lock.h: Include windows-once.h.
(gl_once_t): Define using glwthread_once_t.
(gl_once_define): Define using GLWTHREAD_ONCE_INIT.
(glthread_once): Define using glwthread_once.
(glthread_once_func): Remove declaration.
* lib/glthread/lock.c (glthread_once_func): Remove function.
* modules/windows-once: New file.
* modules/lock (Depends-on): Add windows-once.
|
|
|
|
|
|
|
|
|
|
| |
* lib/glthread/lock.c (glthread_lock_lock_func): Leave the 'started'
field of the guard unchanged if it was already positive.
(glthread_rwlock_rdlock_func): Likewise.
(glthread_rwlock_wrlock_func): Likewise.
(glthread_recursive_lock_lock_func): Likewise.
* lib/glthread/cond.c (glthread_cond_wait_func): Likewise.
(glthread_cond_timedwait_func): Likewise.
|
|
|
|
|
| |
* lib/glthread/cond.c (glthread_cond_timedwait_func): Initialize the
condition variable before looking at the current time.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* m4/threadlib.m4 (gl_THREADLIB_BODY): Test for <threads.h>.
* lib/glthread/thread.h (c11_threads_in_use): New macro.
(pthread_in_use, pth_in_use, thread_in_use): Use it.
* lib/glthread/lock.h (c11_threads_in_use): New macro.
(pthread_in_use, pth_in_use, thread_in_use): Use it.
* lib/glthread/cond.h (c11_threads_in_use): New macro.
(pthread_in_use, pth_in_use, thread_in_use): Use it.
* lib/glthread/tls.h (c11_threads_in_use): New macro.
(pthread_in_use, pth_in_use, thread_in_use): Use it.
|
|
|
|
|
|
|
| |
Reported by Richard W.M. Jones <rjones@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-01/msg00123.html>.
* lib/glthread/thread.h (pthread_create): Don't declare weak.
|
|
|
|
|
| |
* lib/glthread/lock.h (pth_cond_init, pth_cond_await, pth_cond_notify):
Mark as weak.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Devin Hussey <husseydevin@gmail.com>.
Based on a patch by Paul Eggert.
* lib/glthread/lock.h (pthread_in_use): Use 'pthread_mutexattr_gettype'
as witness of libpthread.
* lib/glthread/cond.h (pthread_in_use): Likewise.
* lib/glthread/thread.h (pthread_in_use): Likewise.
* lib/glthread/tls.h (pthread_in_use): Likewise.
|
|
|
|
|
| |
* lib/glthread/lock.h: On FreeBSD, test the weak value of the symbol
'pthread_create', not 'pthread_cancel'.
|
|
|
|
|
|
|
| |
* lib/glthread/thread.h: Include <unistd.h>. Include <signal.h> when
needed; include it outside the C++ extern "C" {} block.
* doc/posix-headers/pthread.texi: Mention the problem with
pthread_atfork on IRIX.
|
|
|
|
| |
* lib/glthread/thread.h: Fix typo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each /archive/html/ part can be replace with /r/.
Run this to induce the change:
git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g'
* ChangeLog: Perform that substitution.
* Makefile: Likewise.
* STATUS-libposix: Likewise.
* build-aux/bootstrap: Likewise.
* doc/maintain.texi: Likewise.
* gnulib-tool: Likewise.
* lib/allocator.h: Likewise.
* lib/argp-ba.c: Likewise.
* lib/argp-pv.c: Likewise.
* lib/canon-host.c: Likewise.
* lib/canonicalize-lgpl.c: Likewise.
* lib/float.in.h: Likewise.
* lib/fstat.c: Likewise.
* lib/getdelim.c: Likewise.
* lib/getprogname.c: Likewise.
* lib/glthread/thread.h: Likewise.
* lib/intprops.h: Likewise.
* lib/mbsrtowcs-state.c: Likewise.
* lib/safe-read.c: Likewise.
* lib/signal.in.h: Likewise.
* lib/stat.c: Likewise.
* lib/stdbool.in.h: Likewise.
* lib/stdio-impl.h: Likewise.
* lib/stdio.in.h: Likewise.
* lib/sysexits.in.h: Likewise.
* lib/timespec.h: Likewise.
* lib/wcsrtombs-state.c: Likewise.
* m4/alloca.m4: Likewise.
* m4/extern-inline.m4: Likewise.
* m4/fstatat.m4: Likewise.
* m4/gnulib-common.m4: Likewise.
* m4/lib-ignore.m4: Likewise.
* m4/printf.m4: Likewise.
* m4/regex.m4: Likewise.
* m4/stat-size.m4: Likewise.
* m4/std-gnu11.m4: Likewise.
* m4/stdbool.m4: Likewise.
* m4/sys_types_h.m4: Likewise.
* m4/threadlib.m4: Likewise.
* m4/vararrays.m4: Likewise.
* pygnulib/GLImport.py: Likewise.
* tests/test-exp.h: Likewise.
* tests/test-exp2.h: Likewise.
* tests/test-expm1.h: Likewise.
* tests/test-fflush2.c: Likewise.
* tests/test-getopt_long.h: Likewise.
* tests/test-intprops.c: Likewise.
* tests/test-log.h: Likewise.
* tests/test-log10.h: Likewise.
* tests/test-log1p.h: Likewise.
* tests/test-log2.h: Likewise.
* tests/test-printf-posix.h: Likewise.
* tests/test-regex.c: Likewise.
* tests/test-snprintf-posix.h: Likewise.
* tests/test-sprintf-posix.h: Likewise.
* tests/test-stdalign.c: Likewise.
* tests/test-stdbool.c: Likewise.
* tests/test-vasnprintf-posix.c: Likewise.
* tests/test-vasprintf-posix.c: Likewise.
* top/maint.mk: Likewise.
|
|
|
|
|
| |
* users.txt: Remove mention of 'newts'.
* lib/localename.c: Update comment about LANG_SOTHO.
|
| |
|
|
|
|
|
|
| |
* lib/glthread/thread.h (pthread_sigmask): Don't declare it weak if
it's defined as a macro.
* modules/thread (Depends-on): Add pthread_sigmask.
|
|
|
|
|
| |
* lib/glthread/lock.h (pthread_rwlockattr_setkind_np): Don't declare
weak on non-glibc platforms.
|
|
|
|
|
|
|
|
|
| |
Reported by Rene Saavedra <rennes@openmailbox.org> in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25821 via Paul Eggert.
* lib/glthread/lock.h: On glibc systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
implementation of rwlocks.
* lib/glthread/lock.c: Likewise.
|
|
|
|
|
|
|
| |
* lib/glthread/lock.h [USE_POSIX_THREADS_WEAK]: Declare also
pthread_rwlockattr_init, pthread_rwlockattr_setkind_np,
pthread_rwlockattr_destroy weak.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The rationale is: 1) Read-preferring read-write locks are prone to
writer starvation if the number of reader threads multiplied by the
percentage of time they have the lock held is too high. 2) Write-
preferring read-write locks are the only reliable way to avoid this.
3) There have been reports of 'test-lock' hanging on glibc systems
http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00009.html,
and glibc indeed implements read-preferring rwlocks by default, see
http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html
and https://sourceware.org/bugzilla/show_bug.cgi?id=13701 .
* m4/pthread_rwlock_rdlock.m4: New file.
* m4/lock.m4 (gl_LOCK): Invoke gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
* lib/glthread/lock.h [USE_POSIX_THREADS]: Test
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlock initialization on glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation
of rwlocks altogether on non-glibc systems without
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER.
[USE_PTH_THREADS]: Use a different implementation of rwlocks altogether.
* lib/glthread/lock.c [USE_POSIX_THREADS]
(glthread_rwlock_init_for_glibc): New function.
[USE_POSIX_THREADS] (glthread_rwlock_rdlock_multithreaded): Update
comment.
[USE_PTH_THREADS]: New implementation of rwlocks.
[USE_WINDOWS_THREADS] (glthread_rwlock_rdlock_func): Prefer writers over
readers.
* modules/lock (Files): Add m4/pthread_rwlock_rdlock.m4.
(Depends-on): Add 'extensions'.
* tests/test-rwlock1.c: New file.
* lock-tests (Files): Add it.
(Depends-on): Add usleep.
(Makefile.am): Add test-rwlock1 to the tests.
|
|
|
|
|
|
|
| |
* lib/glthread/thread.h (pth_init): Declare weak.
(glthread_create, glthread_sigmask, glthread_join, gl_thread_self,
gl_thread_exit): Make sure Pth is initialized before invoking any Pth
function.
|
|
|
|
|
|
|
|
|
|
| |
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
|
|
|
|
|
| |
* lib/glthread/thread.c, lib/glthread/thread.h:
Rudimentary gl_thread support for z/OS.
|
|
|
|
|
|
|
|
|
|
| |
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
|
|
|
|
|
|
| |
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
|
|
|
|
|
|
| |
I ran 'make update-copyright'.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggested by Bruce Korb in:
http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html
* doc/extern-inline.texi (extern inline):
Suggest checking that _GL_INLINE_HEADER_BEGIN is defined.
* lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h:
* lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h:
* lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h:
* lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h:
* lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h:
* lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h:
* lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h:
* lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h:
* lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h:
* lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h:
* lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h:
* lib/xtime.h:
Check that _GL_INLINE_HEADER_BEGIN is defined.
|