Package Exports
- read-write-mutexify
- read-write-mutexify/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (read-write-mutexify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
read-write-mutexify
Like mutexify but with read/write locks
npm install read-write-mutexifyUsage
const RW = require('read-write-mutexify')
const lock = new RW()
// read locks waits for writer locks to be released
const release1 = await lock.read()
const release2 = await lock.read() // make as many as you want
// only one writer can have the write lock and it waits
// for any read lock to be released
const release = await lock.writer()License
MIT