MCPcopy Index your code
hub / github.com/MultithreadedJSBook/code-samples / exec

Method exec

ch6-mutex/mutex.js:29–36  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

27 }
28
29 exec(fn) {
30 this.acquire();
31 try {
32 return fn();
33 } finally {
34 this.release();
35 }
36 }
37}
38
39module.exports = Mutex;

Callers 3

writeMethod · 0.45
readMethod · 0.45

Calls 2

acquireMethod · 0.95
releaseMethod · 0.95

Tested by

no test coverage detected