[]
Latched execution 'pattern'. For simplicity, try use ExecuteIfOpen method. Only if it doesn't fit to your task, use more low level method 'Execute'
public sealed class Latch
Name | Description |
---|---|
Latch() |
Name | Description |
---|---|
IsClosed | Answers question 'Is something already executing?'. |
Name | Description |
---|---|
Execute(Action) | Sets flag (IsClosed will return 'true'), executes action, resets flag (IsClosed will return 'false'). |
ExecuteIfOpen(Action) | If latch is open (IlClosed is 'false'), closes it (IsClosed is 'true'), executes action, opens the latch. If latch is closed, does nothing. |