#include <coherence/util/ThreadGate.hpp>
The EnterBlock object will ensure that the gate is entered and exited as a part of starting and ending the code block. It's used by the COH_GATE_ENTER macro
Public Types | |
enum | BlockType |
The type of GateBlock that will be constructed. | |
Public Member Functions | |
GateBlock (BlockType nType, ThreadGate::Handle hGate, int64_t lTime) | |
Construct a new EnterBlock object entering the supplied gate. | |
GateBlock (const GateBlock &that) | |
Copy constructor used by the COH_GATE_ENTERED macro. | |
~GateBlock () | |
Destroy an EnterBlock object, exiting the associated gate. | |
operator bool () const | |
Boolean conversion for the COH_GATE_ENTER macro. | |
Protected Attributes | |
ThreadGate::Handle | m_hGate |
Gate used by the EnterBlock. | |
BlockType | m_nType |
The operation requested when the GateBlock is entered. |
GateBlock | ( | BlockType | nType, | |
ThreadGate::Handle | hGate, | |||
int64_t | lTime | |||
) |
Construct a new EnterBlock object entering the supplied gate.
nType | the type of GateBlock to construct | |
hGate | the gate to enter | |
lTime | maximum number of milliseconds to wait; pass infinite for forever or immediate for no wait |
Copy constructor used by the COH_GATE_ENTERED macro.
The new block takes over ownership of the gate.
operator bool | ( | ) | const |
Boolean conversion for the COH_GATE_ENTER macro.
IllegalStateException | if the gate is null |