get_mutex library
Classes
- CancellationToken
- A token that can be used to signal cancellation.
- GetMutex
- Mutex
- A reentrant mutex implementation supporting read-write locks.
- RawReadWriteMutex
- A RawReadWriteMutex implementation that allows multiple readers or a single writer.
- SimpleMutex
- A simple non-reentrant mutex implementation.
- SimpleMutexInterface
- Base interface for simple mutex implementations.
- SimpleReentrantMutex
- A simple reentrant mutex implementation.
Enums
- LockPolicy
- Lock policies to manage the order of lock acquisition:
Functions
-
executeCancellableAction<
T> (Future< T> action(), CancellationToken? cancellationToken, Duration? timeout) → Future<T> - Executes an asynchronous action that can be cancelled or timed out.
-
handleCancellationAndTimeout<
T> (Completer< T> completer, {CancellationToken? cancellationToken, Duration? timeout, void onCancelledOrTimedOut()?, required String operationName}) → void - Handles cancellation and timeout for a given operation.
Exceptions / Errors
- CancellationException
- Exception thrown when a lock acquisition is cancelled.
- ReentrantMutexError
- TimeoutException
- Exception thrown when a timeout is exceeded.