Lockable Interface
Package: @esfx/threading-lockable
Declaration
export interface Lockable
Methods
[Lockable.lock](ms)
Takes an exclusive lock.
Declaration
[Lockable.lock](ms?: number): boolean;
Parameters
Returns
true
if the current thread now owns the lock; otherwise, false
.
[Lockable.tryLock]()
Attempts to take an exclusive lock without waiting.
Declaration
[Lockable.tryLock]?(): boolean;
Returns
true
if the current thread now owns the lock; otherwise, false
.
[Lockable.unlock]()
Releases the exclusive lock.
Declaration
[Lockable.unlock](): boolean;
Returns
true
if the current thread previously owned the lock and the lock could be released; otherwise, false
.