Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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: