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# |
|---|
[ObsoleteAttribute("Use GateFactory.NewGate to obtain a Gate.")] public class ThreadGate : Gate |
Remarks
Each call to Enter requires a corresponding call to Exit. For example, the following would ensure proper clean-up using a ThreadGate:
gate.Enter();
try
{
...
}
finally
{
gate.Exit();
}
Similarly, each call to Close should be matched with a call to Open, unless the gate is being destroyed:
gate.Close();
try
{
...
}
finally
{
gate.Open();
}
or:
gate.Close();
gate.Destroy();
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.
Inheritance Hierarchy
Tangosol.Util..::..ThreadGate