From 5f59a34ab747dde8ede7357f3431bf06bd6002fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 8 Mar 2026 17:28:33 +0100 Subject: New upstream version 1.4.2 --- lib/glthread/lock.c | 66 +++++++++++++----------------------------------- lib/glthread/lock.h | 2 +- lib/glthread/once.c | 2 +- lib/glthread/once.h | 2 +- lib/glthread/threadlib.c | 2 +- 5 files changed, 21 insertions(+), 53 deletions(-) (limited to 'lib/glthread') diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c index a2c53dc7..cfb9393c 100644 --- a/lib/glthread/lock.c +++ b/lib/glthread/lock.c @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -261,9 +261,7 @@ int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) { pthread_rwlockattr_t attributes; - int err; - - err = pthread_rwlockattr_init (&attributes); + int err = pthread_rwlockattr_init (&attributes); if (err != 0) return err; /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that @@ -286,9 +284,7 @@ glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_rwlock_init (&lock->rwlock, NULL); + int err = pthread_rwlock_init (&lock->rwlock, NULL); if (err != 0) return err; lock->initialized = 1; @@ -300,9 +296,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -326,9 +320,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -358,11 +350,9 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { - int err; - if (!lock->initialized) return EINVAL; - err = pthread_rwlock_destroy (&lock->rwlock); + int err = pthread_rwlock_destroy (&lock->rwlock); if (err != 0) return err; lock->initialized = 0; @@ -376,9 +366,7 @@ glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_init (&lock->lock, NULL); + int err = pthread_mutex_init (&lock->lock, NULL); if (err != 0) return err; err = pthread_cond_init (&lock->waiting_readers, NULL); @@ -395,9 +383,7 @@ glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether only readers are currently running, and whether the runcount @@ -422,9 +408,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether no readers or writers are currently running. */ @@ -449,9 +433,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_lock (&lock->lock); + int err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; if (lock->runcount < 0) @@ -505,9 +487,7 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { - int err; - - err = pthread_mutex_destroy (&lock->lock); + int err = pthread_mutex_destroy (&lock->lock); if (err != 0) return err; err = pthread_cond_destroy (&lock->waiting_readers); @@ -531,9 +511,7 @@ int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; - int err; - - err = pthread_mutexattr_init (&attributes); + int err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); @@ -560,9 +538,7 @@ int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; - int err; - - err = pthread_mutexattr_init (&attributes); + int err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); @@ -589,9 +565,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) { if (!lock->initialized) { - int err; - - err = pthread_mutex_lock (&lock->guard); + int err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) @@ -621,11 +595,9 @@ glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { - int err; - if (!lock->initialized) return EINVAL; - err = pthread_mutex_destroy (&lock->recmutex); + int err = pthread_mutex_destroy (&lock->recmutex); if (err != 0) return err; lock->initialized = 0; @@ -639,9 +611,7 @@ glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { - int err; - - err = pthread_mutex_init (&lock->mutex, NULL); + int err = pthread_mutex_init (&lock->mutex, NULL); if (err != 0) return err; lock->owner = (pthread_t) 0; @@ -655,9 +625,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) pthread_t self = pthread_self (); if (lock->owner != self) { - int err; - - err = pthread_mutex_lock (&lock->mutex); + int err = pthread_mutex_lock (&lock->mutex); if (err != 0) return err; lock->owner = self; diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index 1554115a..d8190b6c 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/lib/glthread/once.c b/lib/glthread/once.c index 53211af8..b72a4a20 100644 --- a/lib/glthread/once.c +++ b/lib/glthread/once.c @@ -1,5 +1,5 @@ /* Once-only initialization in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/lib/glthread/once.h b/lib/glthread/once.h index 943bd7a2..b6d9ab40 100644 --- a/lib/glthread/once.h +++ b/lib/glthread/once.h @@ -1,5 +1,5 @@ /* Once-only initialization in multithreaded situations. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/lib/glthread/threadlib.c b/lib/glthread/threadlib.c index a6f7688b..5c0ba1f4 100644 --- a/lib/glthread/threadlib.c +++ b/lib/glthread/threadlib.c @@ -1,5 +1,5 @@ /* Multithreading primitives. - Copyright (C) 2005-2025 Free Software Foundation, Inc. + Copyright (C) 2005-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as -- cgit v1.2.3