public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] htl: Fix semaphore reference Date: Sun, 12 Feb 2023 14:57:39 +0000 (GMT) [thread overview] Message-ID: <20230212145739.87F193858D1E@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3d008a92a816d4fcf07701f2d28dd8d6f9244b3b commit 3d008a92a816d4fcf07701f2d28dd8d6f9244b3b Author: Sergey Bugaev <bugaevc@gmail.com> Date: Sun Feb 12 14:10:36 2023 +0300 htl: Fix semaphore reference 'sem' is the opaque 'sem_t', 'isem' is the actual 'struct new_sem'. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-6-bugaevc@gmail.com> Diff: --- sysdeps/htl/sem-timedwait.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sysdeps/htl/sem-timedwait.c b/sysdeps/htl/sem-timedwait.c index 8f2df6e76e..9974e9aeeb 100644 --- a/sysdeps/htl/sem-timedwait.c +++ b/sysdeps/htl/sem-timedwait.c @@ -60,7 +60,7 @@ __sem_timedwait_internal (sem_t *restrict sem, int cancel_oldtype = LIBC_CANCEL_ASYNC(); #if __HAVE_64B_ATOMICS - uint64_t d = atomic_fetch_add_relaxed (&sem->data, + uint64_t d = atomic_fetch_add_relaxed (&isem->data, (uint64_t) 1 << SEM_NWAITERS_SHIFT); pthread_cleanup_push (__sem_wait_cleanup, isem); @@ -72,11 +72,11 @@ __sem_timedwait_internal (sem_t *restrict sem, /* No token, sleep. */ if (timeout) err = __lll_abstimed_wait_intr ( - ((unsigned int *) &sem->data) + SEM_VALUE_OFFSET, + ((unsigned int *) &isem->data) + SEM_VALUE_OFFSET, 0, timeout, flags, clock_id); else err = __lll_wait_intr ( - ((unsigned int *) &sem->data) + SEM_VALUE_OFFSET, + ((unsigned int *) &isem->data) + SEM_VALUE_OFFSET, 0, flags); if (err != 0 && err != KERN_INVALID_ARGUMENT) @@ -92,12 +92,12 @@ __sem_timedwait_internal (sem_t *restrict sem, } /* Token changed */ - d = atomic_load_relaxed (&sem->data); + d = atomic_load_relaxed (&isem->data); } else { /* Try to acquire and dequeue. */ - if (atomic_compare_exchange_weak_acquire (&sem->data, + if (atomic_compare_exchange_weak_acquire (&isem->data, &d, d - 1 - ((uint64_t) 1 << SEM_NWAITERS_SHIFT))) { /* Success */
reply other threads:[~2023-02-12 14:57 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230212145739.87F193858D1E@sourceware.org \ --to=sthibaul@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).