public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* 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

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).