* Why does pthread_mutex_destroy check for an in-use mutex?
@ 2020-07-01 6:17 Florian Weimer
2020-07-01 7:32 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2020-07-01 6:17 UTC (permalink / raw)
To: libc-alpha
This check does not seem to be mandated by POSIX. As far as I can see,
it is the only place where __nusers is actually used.
Almost the same check can be implemented using __owner, except for the
case of a condition variable mutex that is being waited upon. There,
the __owner check incorrectly detects the mutex as unused (so
destruction should proceed), although that is not the case.
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does pthread_mutex_destroy check for an in-use mutex?
2020-07-01 6:17 Why does pthread_mutex_destroy check for an in-use mutex? Florian Weimer
@ 2020-07-01 7:32 ` Andreas Schwab
2020-07-01 7:56 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2020-07-01 7:32 UTC (permalink / raw)
To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer
On Jul 01 2020, Florian Weimer via Libc-alpha wrote:
> This check does not seem to be mandated by POSIX. As far as I can see,
> it is the only place where __nusers is actually used.
Is __nusers actually updated in the elision path?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does pthread_mutex_destroy check for an in-use mutex?
2020-07-01 7:32 ` Andreas Schwab
@ 2020-07-01 7:56 ` Florian Weimer
0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2020-07-01 7:56 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Florian Weimer via Libc-alpha
* Andreas Schwab:
> On Jul 01 2020, Florian Weimer via Libc-alpha wrote:
>
>> This check does not seem to be mandated by POSIX. As far as I can see,
>> it is the only place where __nusers is actually used.
>
> Is __nusers actually updated in the elision path?
It's not. That would be a bug if it actually mattered, right?
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-01 7:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 6:17 Why does pthread_mutex_destroy check for an in-use mutex? Florian Weimer
2020-07-01 7:32 ` Andreas Schwab
2020-07-01 7:56 ` Florian Weimer
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).