News for hackers. Stuff that matters.
Re:MutexProtected: A C++ Pattern for Easier Concurrency by ot on Thursday April 06, 2023 @02:50AM (#35465050)
That's how folly::Synchronized works, it supports both the callback interface as MutexProtected, and an interface that returns a RAII lock holder that gives access to the underlying object. It is generally the preferred synchronization utility at Meta and thus it is widely used.

https://github.com/facebook/folly/blob/main/folly/docs/Synch...

Re:MutexProtected: A C++ Pattern for Easier Concurrency by biesnecker on Thursday April 06, 2023 @10:08AM (#35468506)
As someone who had to occasionally write C++ in FBCode but not enough to really feel comfortable with it, `folly::Synchronized` and its straightforward semantics were really nice.