Hacker News new | ask | show | jobs
by gpderetta 678 days ago
It is not an engineering decision. There is no way that a thread can safely unlock the mutex before the CV wait without risking missed wake-ups.

The mutex unlock and CV wait must be atomic for the CV to work correctly. There is no way around it.