diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2026-03-26 12:53:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-26 12:53:53 +0100 |
| commit | 13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 (patch) | |
| tree | 3aa7186fe092e42783dc7e981dc39a74ea61c466 /gl/glthread | |
| parent | 9d8503f90ef25b2cecd324dc118e441f40233ea8 (diff) | |
| download | monitoring-plugins-13e14a6bfd9f29cbfeab0c5161d2a994f97532e7.tar.gz | |
Update/gnulib 2026 03 (#2247)
* Sync with the 202601-stable Gnulib code (4a3650d887)
* Ignore more deps stuff in gnulib
* Remove autogenerated gnulib files
* Ignore more gnulib generated headers
Diffstat (limited to 'gl/glthread')
| -rw-r--r-- | gl/glthread/lock.c | 68 | ||||
| -rw-r--r-- | gl/glthread/lock.h | 4 | ||||
| -rw-r--r-- | gl/glthread/once.c | 2 | ||||
| -rw-r--r-- | gl/glthread/once.h | 2 | ||||
| -rw-r--r-- | gl/glthread/threadlib.c | 2 |
5 files changed, 23 insertions, 55 deletions
diff --git a/gl/glthread/lock.c b/gl/glthread/lock.c index dace4fda..cfb9393c 100644 --- a/gl/glthread/lock.c +++ b/gl/glthread/lock.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Locking in multithreaded situations. | 1 | /* Locking in multithreaded situations. |
| 2 | Copyright (C) 2005-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
| @@ -255,15 +255,13 @@ glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) | |||
| 255 | # if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP | 255 | # if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP |
| 256 | 256 | ||
| 257 | # if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER | 257 | # if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER |
| 258 | /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ | 258 | /* glibc with bug https://sourceware.org/PR13701 */ |
| 259 | 259 | ||
| 260 | int | 260 | int |
| 261 | glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) | 261 | glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) |
| 262 | { | 262 | { |
| 263 | pthread_rwlockattr_t attributes; | 263 | pthread_rwlockattr_t attributes; |
| 264 | int err; | 264 | int err = pthread_rwlockattr_init (&attributes); |
| 265 | |||
| 266 | err = pthread_rwlockattr_init (&attributes); | ||
| 267 | if (err != 0) | 265 | if (err != 0) |
| 268 | return err; | 266 | return err; |
| 269 | /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that | 267 | /* 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) | |||
| 286 | int | 284 | int |
| 287 | glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) | 285 | glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) |
| 288 | { | 286 | { |
| 289 | int err; | 287 | int err = pthread_rwlock_init (&lock->rwlock, NULL); |
| 290 | |||
| 291 | err = pthread_rwlock_init (&lock->rwlock, NULL); | ||
| 292 | if (err != 0) | 288 | if (err != 0) |
| 293 | return err; | 289 | return err; |
| 294 | lock->initialized = 1; | 290 | lock->initialized = 1; |
| @@ -300,9 +296,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) | |||
| 300 | { | 296 | { |
| 301 | if (!lock->initialized) | 297 | if (!lock->initialized) |
| 302 | { | 298 | { |
| 303 | int err; | 299 | int err = pthread_mutex_lock (&lock->guard); |
| 304 | |||
| 305 | err = pthread_mutex_lock (&lock->guard); | ||
| 306 | if (err != 0) | 300 | if (err != 0) |
| 307 | return err; | 301 | return err; |
| 308 | if (!lock->initialized) | 302 | if (!lock->initialized) |
| @@ -326,9 +320,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) | |||
| 326 | { | 320 | { |
| 327 | if (!lock->initialized) | 321 | if (!lock->initialized) |
| 328 | { | 322 | { |
| 329 | int err; | 323 | int err = pthread_mutex_lock (&lock->guard); |
| 330 | |||
| 331 | err = pthread_mutex_lock (&lock->guard); | ||
| 332 | if (err != 0) | 324 | if (err != 0) |
| 333 | return err; | 325 | return err; |
| 334 | if (!lock->initialized) | 326 | if (!lock->initialized) |
| @@ -358,11 +350,9 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) | |||
| 358 | int | 350 | int |
| 359 | glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) | 351 | glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) |
| 360 | { | 352 | { |
| 361 | int err; | ||
| 362 | |||
| 363 | if (!lock->initialized) | 353 | if (!lock->initialized) |
| 364 | return EINVAL; | 354 | return EINVAL; |
| 365 | err = pthread_rwlock_destroy (&lock->rwlock); | 355 | int err = pthread_rwlock_destroy (&lock->rwlock); |
| 366 | if (err != 0) | 356 | if (err != 0) |
| 367 | return err; | 357 | return err; |
| 368 | lock->initialized = 0; | 358 | lock->initialized = 0; |
| @@ -376,9 +366,7 @@ glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) | |||
| 376 | int | 366 | int |
| 377 | glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) | 367 | glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) |
| 378 | { | 368 | { |
| 379 | int err; | 369 | int err = pthread_mutex_init (&lock->lock, NULL); |
| 380 | |||
| 381 | err = pthread_mutex_init (&lock->lock, NULL); | ||
| 382 | if (err != 0) | 370 | if (err != 0) |
| 383 | return err; | 371 | return err; |
| 384 | err = pthread_cond_init (&lock->waiting_readers, NULL); | 372 | err = pthread_cond_init (&lock->waiting_readers, NULL); |
| @@ -395,9 +383,7 @@ glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) | |||
| 395 | int | 383 | int |
| 396 | glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) | 384 | glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) |
| 397 | { | 385 | { |
| 398 | int err; | 386 | int err = pthread_mutex_lock (&lock->lock); |
| 399 | |||
| 400 | err = pthread_mutex_lock (&lock->lock); | ||
| 401 | if (err != 0) | 387 | if (err != 0) |
| 402 | return err; | 388 | return err; |
| 403 | /* Test whether only readers are currently running, and whether the runcount | 389 | /* Test whether only readers are currently running, and whether the runcount |
| @@ -422,9 +408,7 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) | |||
| 422 | int | 408 | int |
| 423 | glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) | 409 | glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) |
| 424 | { | 410 | { |
| 425 | int err; | 411 | int err = pthread_mutex_lock (&lock->lock); |
| 426 | |||
| 427 | err = pthread_mutex_lock (&lock->lock); | ||
| 428 | if (err != 0) | 412 | if (err != 0) |
| 429 | return err; | 413 | return err; |
| 430 | /* Test whether no readers or writers are currently running. */ | 414 | /* Test whether no readers or writers are currently running. */ |
| @@ -449,9 +433,7 @@ glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) | |||
| 449 | int | 433 | int |
| 450 | glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) | 434 | glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) |
| 451 | { | 435 | { |
| 452 | int err; | 436 | int err = pthread_mutex_lock (&lock->lock); |
| 453 | |||
| 454 | err = pthread_mutex_lock (&lock->lock); | ||
| 455 | if (err != 0) | 437 | if (err != 0) |
| 456 | return err; | 438 | return err; |
| 457 | if (lock->runcount < 0) | 439 | if (lock->runcount < 0) |
| @@ -505,9 +487,7 @@ glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) | |||
| 505 | int | 487 | int |
| 506 | glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) | 488 | glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) |
| 507 | { | 489 | { |
| 508 | int err; | 490 | int err = pthread_mutex_destroy (&lock->lock); |
| 509 | |||
| 510 | err = pthread_mutex_destroy (&lock->lock); | ||
| 511 | if (err != 0) | 491 | if (err != 0) |
| 512 | return err; | 492 | return err; |
| 513 | err = pthread_cond_destroy (&lock->waiting_readers); | 493 | err = pthread_cond_destroy (&lock->waiting_readers); |
| @@ -531,9 +511,7 @@ int | |||
| 531 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) | 511 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) |
| 532 | { | 512 | { |
| 533 | pthread_mutexattr_t attributes; | 513 | pthread_mutexattr_t attributes; |
| 534 | int err; | 514 | int err = pthread_mutexattr_init (&attributes); |
| 535 | |||
| 536 | err = pthread_mutexattr_init (&attributes); | ||
| 537 | if (err != 0) | 515 | if (err != 0) |
| 538 | return err; | 516 | return err; |
| 539 | err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); | 517 | err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); |
| @@ -560,9 +538,7 @@ int | |||
| 560 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) | 538 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) |
| 561 | { | 539 | { |
| 562 | pthread_mutexattr_t attributes; | 540 | pthread_mutexattr_t attributes; |
| 563 | int err; | 541 | int err = pthread_mutexattr_init (&attributes); |
| 564 | |||
| 565 | err = pthread_mutexattr_init (&attributes); | ||
| 566 | if (err != 0) | 542 | if (err != 0) |
| 567 | return err; | 543 | return err; |
| 568 | err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); | 544 | err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); |
| @@ -589,9 +565,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) | |||
| 589 | { | 565 | { |
| 590 | if (!lock->initialized) | 566 | if (!lock->initialized) |
| 591 | { | 567 | { |
| 592 | int err; | 568 | int err = pthread_mutex_lock (&lock->guard); |
| 593 | |||
| 594 | err = pthread_mutex_lock (&lock->guard); | ||
| 595 | if (err != 0) | 569 | if (err != 0) |
| 596 | return err; | 570 | return err; |
| 597 | if (!lock->initialized) | 571 | if (!lock->initialized) |
| @@ -621,11 +595,9 @@ glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) | |||
| 621 | int | 595 | int |
| 622 | glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) | 596 | glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) |
| 623 | { | 597 | { |
| 624 | int err; | ||
| 625 | |||
| 626 | if (!lock->initialized) | 598 | if (!lock->initialized) |
| 627 | return EINVAL; | 599 | return EINVAL; |
| 628 | err = pthread_mutex_destroy (&lock->recmutex); | 600 | int err = pthread_mutex_destroy (&lock->recmutex); |
| 629 | if (err != 0) | 601 | if (err != 0) |
| 630 | return err; | 602 | return err; |
| 631 | lock->initialized = 0; | 603 | lock->initialized = 0; |
| @@ -639,9 +611,7 @@ glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) | |||
| 639 | int | 611 | int |
| 640 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) | 612 | glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) |
| 641 | { | 613 | { |
| 642 | int err; | 614 | int err = pthread_mutex_init (&lock->mutex, NULL); |
| 643 | |||
| 644 | err = pthread_mutex_init (&lock->mutex, NULL); | ||
| 645 | if (err != 0) | 615 | if (err != 0) |
| 646 | return err; | 616 | return err; |
| 647 | lock->owner = (pthread_t) 0; | 617 | lock->owner = (pthread_t) 0; |
| @@ -655,9 +625,7 @@ glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) | |||
| 655 | pthread_t self = pthread_self (); | 625 | pthread_t self = pthread_self (); |
| 656 | if (lock->owner != self) | 626 | if (lock->owner != self) |
| 657 | { | 627 | { |
| 658 | int err; | 628 | int err = pthread_mutex_lock (&lock->mutex); |
| 659 | |||
| 660 | err = pthread_mutex_lock (&lock->mutex); | ||
| 661 | if (err != 0) | 629 | if (err != 0) |
| 662 | return err; | 630 | return err; |
| 663 | lock->owner = self; | 631 | lock->owner = self; |
diff --git a/gl/glthread/lock.h b/gl/glthread/lock.h index d6ccc202..d8190b6c 100644 --- a/gl/glthread/lock.h +++ b/gl/glthread/lock.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Locking in multithreaded situations. | 1 | /* Locking in multithreaded situations. |
| 2 | Copyright (C) 2005-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
| @@ -239,7 +239,7 @@ typedef pthread_rwlock_t gl_rwlock_t; | |||
| 239 | # endif | 239 | # endif |
| 240 | # define glthread_rwlock_init(LOCK) \ | 240 | # define glthread_rwlock_init(LOCK) \ |
| 241 | (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0) | 241 | (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0) |
| 242 | # else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ | 242 | # else /* glibc with bug https://sourceware.org/PR13701 */ |
| 243 | # define gl_rwlock_initializer \ | 243 | # define gl_rwlock_initializer \ |
| 244 | PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP | 244 | PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP |
| 245 | # define glthread_rwlock_init(LOCK) \ | 245 | # define glthread_rwlock_init(LOCK) \ |
diff --git a/gl/glthread/once.c b/gl/glthread/once.c index 53211af8..b72a4a20 100644 --- a/gl/glthread/once.c +++ b/gl/glthread/once.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Once-only initialization in multithreaded situations. | 1 | /* Once-only initialization in multithreaded situations. |
| 2 | Copyright (C) 2005-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
diff --git a/gl/glthread/once.h b/gl/glthread/once.h index 943bd7a2..b6d9ab40 100644 --- a/gl/glthread/once.h +++ b/gl/glthread/once.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Once-only initialization in multithreaded situations. | 1 | /* Once-only initialization in multithreaded situations. |
| 2 | Copyright (C) 2005-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
diff --git a/gl/glthread/threadlib.c b/gl/glthread/threadlib.c index a6f7688b..5c0ba1f4 100644 --- a/gl/glthread/threadlib.c +++ b/gl/glthread/threadlib.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Multithreading primitives. | 1 | /* Multithreading primitives. |
| 2 | Copyright (C) 2005-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
