mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 21:49:33 +02:00
glibc: nptl Fix indentation
The following commits have been cherry-picked from Glibc master branch: Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847 [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=ee6c14ed59d480720721aaacc5fb03213dc153da [2] https://sourceware.org/pipermail/libc-stable/2025-July/002280.html (From OE-Core rev: f54e082df2f07893f66183089518f98cb792f22e) Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
2105de9c82
commit
42b3adafcc
149
meta/recipes-core/glibc/glibc/0026-PR25847-7.patch
Normal file
149
meta/recipes-core/glibc/glibc/0026-PR25847-7.patch
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
From 1077953950d1e8864c63222967141c67f51297f8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Malte Skarupke <malteskarupke@fastmail.fm>
|
||||||
|
Date: Tue, 14 Oct 2025 06:27:04 -0700
|
||||||
|
Subject: [PATCH] nptl: Fix indentation
|
||||||
|
|
||||||
|
In my previous change I turned a nested loop into a simple loop. I'm doing
|
||||||
|
the resulting indentation changes in a separate commit to make the diff on
|
||||||
|
the previous commit easier to review.
|
||||||
|
|
||||||
|
The following commits have been cherry-picked from Glibc master branch:
|
||||||
|
Bug : https://sourceware.org/bugzilla/show_bug.cgi?id=25847
|
||||||
|
commit: ee6c14ed59d480720721aaacc5fb03213dc153da
|
||||||
|
|
||||||
|
Upstream-Status: Submitted
|
||||||
|
[https://sourceware.org/pipermail/libc-stable/2025-July/002280.html]
|
||||||
|
|
||||||
|
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
|
||||||
|
---
|
||||||
|
nptl/pthread_cond_wait.c | 110 +++++++++++++++++++--------------------
|
||||||
|
1 file changed, 55 insertions(+), 55 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
|
||||||
|
index c8c99bbf..adf26a80 100644
|
||||||
|
--- a/nptl/pthread_cond_wait.c
|
||||||
|
+++ b/nptl/pthread_cond_wait.c
|
||||||
|
@@ -383,65 +383,65 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- while (1)
|
||||||
|
- {
|
||||||
|
- /* Now wait until a signal is available in our group or it is closed.
|
||||||
|
- Acquire MO so that if we observe (signals == lowseq) after group
|
||||||
|
- switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||||
|
- store and will see the prior update of __g1_start done while switching
|
||||||
|
- groups too. */
|
||||||
|
- unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||||
|
- uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||||
|
- unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||||
|
-
|
||||||
|
- if (seq < (g1_start >> 1))
|
||||||
|
- {
|
||||||
|
- /* If the group is closed already,
|
||||||
|
- then this waiter originally had enough extra signals to
|
||||||
|
- consume, up until the time its group was closed. */
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* If there is an available signal, don't block.
|
||||||
|
- If __g1_start has advanced at all, then we must be in G1
|
||||||
|
- by now, perhaps in the process of switching back to an older
|
||||||
|
- G2, but in either case we're allowed to consume the available
|
||||||
|
- signal and should not block anymore. */
|
||||||
|
- if ((int)(signals - lowseq) >= 2)
|
||||||
|
- {
|
||||||
|
- /* Try to grab a signal. See above for MO. (if we do another loop
|
||||||
|
- iteration we need to see the correct value of g1_start) */
|
||||||
|
- if (atomic_compare_exchange_weak_acquire (
|
||||||
|
- cond->__data.__g_signals + g,
|
||||||
|
+ while (1)
|
||||||
|
+ {
|
||||||
|
+ /* Now wait until a signal is available in our group or it is closed.
|
||||||
|
+ Acquire MO so that if we observe (signals == lowseq) after group
|
||||||
|
+ switching in __condvar_quiesce_and_switch_g1, we synchronize with that
|
||||||
|
+ store and will see the prior update of __g1_start done while switching
|
||||||
|
+ groups too. */
|
||||||
|
+ unsigned int signals = atomic_load_acquire (cond->__data.__g_signals + g);
|
||||||
|
+ uint64_t g1_start = __condvar_load_g1_start_relaxed (cond);
|
||||||
|
+ unsigned int lowseq = (g1_start & 1) == g ? signals : g1_start & ~1U;
|
||||||
|
+
|
||||||
|
+ if (seq < (g1_start >> 1))
|
||||||
|
+ {
|
||||||
|
+ /* If the group is closed already,
|
||||||
|
+ then this waiter originally had enough extra signals to
|
||||||
|
+ consume, up until the time its group was closed. */
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* If there is an available signal, don't block.
|
||||||
|
+ If __g1_start has advanced at all, then we must be in G1
|
||||||
|
+ by now, perhaps in the process of switching back to an older
|
||||||
|
+ G2, but in either case we're allowed to consume the available
|
||||||
|
+ signal and should not block anymore. */
|
||||||
|
+ if ((int)(signals - lowseq) >= 2)
|
||||||
|
+ {
|
||||||
|
+ /* Try to grab a signal. See above for MO. (if we do another loop
|
||||||
|
+ iteration we need to see the correct value of g1_start) */
|
||||||
|
+ if (atomic_compare_exchange_weak_acquire (
|
||||||
|
+ cond->__data.__g_signals + g,
|
||||||
|
&signals, signals - 2))
|
||||||
|
- break;
|
||||||
|
- else
|
||||||
|
- continue;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- // Now block.
|
||||||
|
- struct _pthread_cleanup_buffer buffer;
|
||||||
|
- struct _condvar_cleanup_buffer cbuffer;
|
||||||
|
- cbuffer.wseq = wseq;
|
||||||
|
- cbuffer.cond = cond;
|
||||||
|
- cbuffer.mutex = mutex;
|
||||||
|
- cbuffer.private = private;
|
||||||
|
- __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||||
|
-
|
||||||
|
- err = __futex_abstimed_wait_cancelable64 (
|
||||||
|
- cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||||
|
-
|
||||||
|
- __pthread_cleanup_pop (&buffer, 0);
|
||||||
|
-
|
||||||
|
- if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||||
|
- {
|
||||||
|
- /* If we timed out, we effectively cancel waiting. */
|
||||||
|
- __condvar_cancel_waiting (cond, seq, g, private);
|
||||||
|
- result = err;
|
||||||
|
break;
|
||||||
|
- }
|
||||||
|
+ else
|
||||||
|
+ continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Now block.
|
||||||
|
+ struct _pthread_cleanup_buffer buffer;
|
||||||
|
+ struct _condvar_cleanup_buffer cbuffer;
|
||||||
|
+ cbuffer.wseq = wseq;
|
||||||
|
+ cbuffer.cond = cond;
|
||||||
|
+ cbuffer.mutex = mutex;
|
||||||
|
+ cbuffer.private = private;
|
||||||
|
+ __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
|
||||||
|
+
|
||||||
|
+ err = __futex_abstimed_wait_cancelable64 (
|
||||||
|
+ cond->__data.__g_signals + g, signals, clockid, abstime, private);
|
||||||
|
+
|
||||||
|
+ __pthread_cleanup_pop (&buffer, 0);
|
||||||
|
+
|
||||||
|
+ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
|
||||||
|
+ {
|
||||||
|
+ /* If we timed out, we effectively cancel waiting. */
|
||||||
|
+ __condvar_cancel_waiting (cond, seq, g, private);
|
||||||
|
+ result = err;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Confirm that we have been woken. We do that before acquiring the mutex
|
||||||
|
to allow for execution of pthread_cond_destroy while having acquired the
|
||||||
|
mutex. */
|
||||||
|
--
|
||||||
|
2.49.0
|
||||||
|
|
||||||
@@ -68,6 +68,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
|||||||
file://0026-PR25847-4.patch \
|
file://0026-PR25847-4.patch \
|
||||||
file://0026-PR25847-5.patch \
|
file://0026-PR25847-5.patch \
|
||||||
file://0026-PR25847-6.patch \
|
file://0026-PR25847-6.patch \
|
||||||
|
file://0026-PR25847-7.patch \
|
||||||
\
|
\
|
||||||
file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \
|
file://0001-Revert-Linux-Implement-a-useful-version-of-_startup_.patch \
|
||||||
file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \
|
file://0002-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch \
|
||||||
|
|||||||
Reference in New Issue
Block a user