[vlc-devel] [PATCH] test: add thread test

Rémi Denis-Courmont remi at remlab.net
Sat Mar 21 07:32:13 CET 2020


Le perjantaina 20. maaliskuuta 2020, 22.32.32 EET Romain Vimont a écrit :
> On 3/20/20 8:53 PM, Rémi Denis-Courmont wrote:
> > Le perjantaina 20. maaliskuuta 2020, 20.28.21 EET Romain Vimont a écrit :
> >> A thread calling cond_signal() may not "signal itself" since it's not
> >> cond_wait()ing. :/
> > 
> > Sure it can. That's the whole point.
> 
> For pthread at least, it seems it cannot:
> https://linux.die.net/man/3/pthread_cond_signal

Sure it can. At some versions of glibc even do it.

> > The pthread_cond_broadcast() and pthread_cond_signal() functions shall
> > have no effect if there are no threads currently blocked on cond.
> Where is it authorized to behave that way?

If it's not forbidden, it's allowed.

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list