Re: pthread_cond_signal/broadcast: necessary to hold mutex?
Jörg Sonnenberger <[email protected]> Wed, 25 Mar 2026 00:37:22 +0100
| Newsgroups | gmane.os.netbsd.current |
|---|---|
| Message-ID | <[email protected]> |
On 3/25/26 12:03 AM, Greg Troxel wrote: > Thus, I conclude that the right thing is > > pthread_mutex_lock() > pthread_cond_signal() > pthread_mutex_unlock() Why do you signal a CV without actually changing some condition? If you see something like the above in real world code, it likely has a completely broken locking strategy. Joerg