0.0.3 • Published 8 months ago
@tscommon/mutex v0.0.3
Mutex - API
A mutual exclusion primitive useful for protecting shared data.
This mutex will block async contexts waiting for the lock to become available. The mutex can be created via a new constructor. Each mutex has a type parameter which represents the data that it is protecting. The data can only be accessed through the RAII guards returned from lock
and tryLock
, which guarantees that the data is only ever accessed when the mutex is locked.