Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/async/mutex.ts>Mutex#acquire

🦕 Asynchronous primitive modules loosely port from Python's asyncio for Deno.
Go to Latest
method Mutex.prototype.acquire
import { Mutex } from "https://deno.land/x/async@v2.0.0/mutex.ts";

Acquire the mutex, waiting if necessary for it to become available.

Returns

Promise<void>

A Promise that resolves when the mutex is acquired.