Package Exports
- @zingle/mutex
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 (@zingle/mutex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
The mutex
function creates synchronization primitives for values or objects.
Usage
const mutex = require("@zingle/mutex");
function critical(resource) {
if (let release = mutex(resource)) {
// ...do critical things...
release();
} else {
throw new Error("could not acquire lock");
}
}