18 Sep
2013
18 Sep
'13
4:33 p.m.
On 18 September 2013 17:28, Gottlob Frege wrote:
But it still doesn't make it easy to use. It might have been easier to somehow wrap the lock and CV together (and a lambda for the condition?) and tell people to make sure they also lock the same CV+lock thing when pushing/pulling from the queue.
I think the problem with wrapping them together is that the binding of the three things is dynamic, not static. It's OK to use the same CV with different mutexes (as long as no waits using different mutexes ever overlap) although doing so correctly can be tricky :)