12c (12.2.1.4.0)
E90869-02
Namespace: Tangosol.Util
Assembly: Coherence (in Coherence.dll) Version: 12.2.1.4014 (12.2.1.4014)
Syntax
C# |
---|
public interface Gate |
Remarks
Each call to Enter requires a corresponding call to Exit. For example, the following would ensure proper clean-up using a Gate:
gate.Enter(); try { ... } finally { gate.Exit(); }
Similarly, each call to Close should be matched with a call to Open:
gate.Close(); try { ... } finally { gate.Open(); }
The Enter/Exit calls can be nested; the same thread can invoke Enter multiple times as long as Exit is invoked a corresponding number of times. The Close/Open calls work in the same manner. Lastly, the thread that closes the gate may continue to Enter/Exit the gate even when it is closed since that thread has exclusive control of the gate.