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

> MutexProtected<T> but can be locked with MutexProtected<T>::lock() which returns a MutexLocked<T> object. That object then cleans up the lock when it goes out of scope, and also provides direct access to the enclosed type.

In fact, MutexProtected provides ::lock_exclusive() and ::lock_shared() methods which do exactly that. The article just fails to mention them. https://github.com/SerenityOS/serenity/blob/master/Kernel/Lo...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: