Lock
Overview
This class represents simple wait lock that allows to block current thread until signal is received.
Use case
You can use this class to wait for different actions to complete
var threadLock := new Lock;
async begin
//perform action on another thread
threadLock.Signal;
end;
//block current thread and wait for other thread to send a signal.
threadLock.WaitFor;
Location
- Reference:
- RemObjects.Elements.EUnit.dll .NET, .NET Standard 2.0
- remobjects.elements.eunit.jar Cooper
- EUnit.fx Island, macOS-x86_64
- libEUnit.fx Toffee
- Namespace: RemObjects.Elements.EUnit
- Ancestry: AbstractLock | Lock
Instance Methods
Reset override
Sets internal state of the lock to non signaled.
method Resetvoid Reset()func Reset()void Reset()Sub Reset()Signal override
Sets internal state to singaled allowing waiting threads to proceed.
method Signalvoid Signal()func Signal()void Signal()Sub Signal()WaitFor override
Blocks current thread until signaled.
method WaitForvoid WaitFor()func WaitFor()void WaitFor()Sub WaitFor()Blocks current thread until signaled for specified amoun of milliseconds.
method WaitFor(Timeout: Int32): BooleanBoolean WaitFor(Int32 Timeout)func WaitFor(_ Timeout: Int32) -> BooleanBoolean WaitFor(Integer Timeout)Function WaitFor(Timeout As Int32) As BooleanParameters:
- Timeout: The number of milliseconds to wait.