DataMutex is a Rust style Mutex that's templated on the type of data that it's locking.
We've had an implementation of this in EME for a while but it hasn't been used more widely. I've moved DataMutex from EME to xpcom/threads to encourage it's use. Generally, one should prefer to use a DataMutex as it makes it clear what data is being protected by the mutex and also ensures the mutex is acquired before giving access to the data inside. Also, if you're in JS engine the equivalent is js::ExclusiveData. Perhaps one day these could be unified in MFBT but for now they're separate. -Jeff _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform