mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] pthread_mutex_timedlock
@ 2024-10-04 13:02 Daniele GMail
  2024-10-04 14:16 ` Samuel Holland
  0 siblings, 1 reply; 7+ messages in thread
From: Daniele GMail @ 2024-10-04 13:02 UTC (permalink / raw)
  To: musl

Hi,
I have a question about pthread_mutex_timedlock.

From the man page I see

[...]

If the Timers option is supported, the timeout shall be based on the
CLOCK_REALTIME clock; if the Timers option is not supported, the
timeout shall be based on the system clock as returned by the time()
function.

[...]

Can anybody explain me why there's no possibility to choose a different
clock like could be done for the pthread_cond_timedwait?

I have a lot of places in my code where timedlock of mutexes affected
by time changes could lead to problems and it is really difficult to
distinguish timeouts caused by time changes from other ones in order to
decide how to react.

Can someone point me to a portable workaround for this?

Thanks in advance,
Daniele.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-09 20:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-04 13:02 [musl] pthread_mutex_timedlock Daniele GMail
2024-10-04 14:16 ` Samuel Holland
2024-10-04 15:04   ` Daniele GMail
2024-10-05  4:18     ` zxuiji
2024-10-07  8:10       ` Daniele GMail
2024-10-07 19:44         ` zxuiji
2024-10-09 20:33           ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).