diff --git a/lib/src/lock.dart b/lib/src/lock.dart index d5cfe4c..e5cfb97 100644 --- a/lib/src/lock.dart +++ b/lib/src/lock.dart @@ -1,32 +1,5 @@ part of "../async_locks.dart"; -/// Mutex lock to guarantee exclusive access to a shared state. -/// -/// A [Lock] object can be in one of two states: "locked" or "unlocked". -/// -/// If the lock is "locked", all futures that call [acquire] will be put in a waiting FIFO queue -/// and will proceed in order for each [release] call. -/// -/// If the lock is "unlocked", calling [acquire] will set the lock to the "locked" state and -/// return immediately. -/// -/// Example usage: -/// ```dart -/// final lock = Lock(); -/// -/// // Acquire the lock -/// await lock.acquire(); -/// -/// try { -/// // Perform exclusive operations on the shared state -/// // ... -/// } finally { -/// // Release the lock -/// lock.release(); -/// } -/// ``` -/// -/// See also: [Python documentation](https://docs.python.org/3/library/asyncio-sync.html#asyncio.Lock) /// Mutex lock to guarantee exclusive access to a shared state. /// /// A [Lock] object can be in one of two states: "locked" or "unlocked".