(fun)
| 5219 | |
| 5220 | // same as the writelock, but multiple can run at once |
| 5221 | function readLock(fun) { |
| 5222 | return function (...args) { |
| 5223 | db._queue.push({ |
| 5224 | fun, |
| 5225 | args, |
| 5226 | type: 'read' |
| 5227 | }); |
| 5228 | |
| 5229 | if (db._queue.length === 1) { |
| 5230 | nextTick(executeNext); |
| 5231 | } |
| 5232 | }; |
| 5233 | } |
| 5234 | |
| 5235 | function formatSeq(n) { |
| 5236 | return ('0000000000000000' + n).slice(-16); |
no outgoing calls
no test coverage detected
searching dependent graphs…