Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gpderetta
on April 6, 2023
|
parent
|
context
|
favorite
| on:
MutexProtected: A C++ Pattern for Easier Concurren...
Another common addition to these lockable objects is having a free function variant of 'with' that allows visiting multiple objects:
MutexProtected<X> x; MutexProtected<Y> y; ... with(x, y, [](X& x, Y& y) {....} );
Using the scoped_lock protocol this can avoid deadlocks.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: