MCPcopy Create free account
hub / github.com/Botloader/botloader / withLocked

Method withLocked

components/runtime/src/ts/core_util.ts:225–233  ·  view source on GitHub ↗

* Run the provided function exclusively on the lock

(cb: () => T)

Source from the content-addressed store, hash-verified

223 * Run the provided function exclusively on the lock
224 */
225 async withLocked<T>(cb: () => T): Promise<Awaited<T>> {
226 await this.lock()
227
228 try {
229 return await cb()
230 } finally {
231 this.unlock()
232 }
233 }
234}
235
236export function base64Encode(data: Uint8Array): string {

Callers 1

test_async_lock.tsFile · 0.80

Calls 2

lockMethod · 0.95
unlockMethod · 0.95

Tested by

no test coverage detected