CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2025/06/24 03:24:20
Modified files:
usr.sbin/rpki-client: parser.c
Log message:
First emit pthread signal, then unlock mutex
POSIX says this:
The pthread_cond_broadcast() or pthread_cond_signal() functions may
be called by a thread whether or not it currently owns the mutex
that threads calling pthread_cond_clockwait(),
pthread_cond_timedwait(), or pthread_cond_wait() have associated
with the condition variable during their waits; however, if
predictable scheduling behavior is required, then that mutex shall
be locked by the thread calling pthread_cond_broadcast() or
pthread_cond_signal().
While both ordering approaches are correct, the predictable scheduling
pattern is preferred.
"yes" kettenis@
"clearer to hold mutex around the signal" tedu@