* Execute an async function while holding the lock
(fn: () => Promise<T>)
| 643 | * Execute an async function while holding the lock |
| 644 | */ |
| 645 | async withLockAsync<T>(fn: () => Promise<T>): Promise<T> { |
| 646 | this.acquire(); |
| 647 | try { |
| 648 | return await fn(); |
| 649 | } finally { |
| 650 | this.release(); |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | /** |
| 655 | * Check if a process is still running |
no test coverage detected