Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pthread_cond_signal/broadcast: necessary to hold mutex?



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


Home | Main Index | Thread Index | Old Index