Implementation of SystemCondition for Unix-like systems. More...
Collaboration diagram for ns3::SystemConditionPrivate:Public Member Functions | |
| SystemConditionPrivate () | |
| Constructor. More... | |
| ~SystemConditionPrivate () | |
| Destructor. More... | |
| void | Broadcast (void) |
| Broadcast the condition. More... | |
| bool | GetCondition (void) |
| Get the condition value. More... | |
| void | SetCondition (bool condition) |
| Set the condition. More... | |
| void | Signal (void) |
| Signal the condition. More... | |
| bool | TimedWait (uint64_t ns) |
| Unset the condition, then wait for a limited amount of wall-clock time for another thread to set it with SetCondition. More... | |
| void | Wait (void) |
| Unset the condition, then wait for another thread to set it with SetCondition. More... | |
Static Public Attributes | |
| static const uint64_t | NS_PER_SEC = (uint64_t)1000000000 |
| Conversion from ns to s. More... | |
Private Attributes | |
| pthread_cond_t | m_cond |
| The pthread condition variable. More... | |
| bool | m_condition |
| The condition state. More... | |
| pthread_mutex_t | m_mutex |
| Mutex controlling access to the condition. More... | |
Implementation of SystemCondition for Unix-like systems.
Definition at line 43 of file unix-system-condition.cc.
| ns3::SystemConditionPrivate::SystemConditionPrivate | ( | ) |
Constructor.
Definition at line 93 of file unix-system-condition.cc.
References m_cond, m_condition, m_mutex, and NS_LOG_FUNCTION.
| ns3::SystemConditionPrivate::~SystemConditionPrivate | ( | ) |
Destructor.
Definition at line 118 of file unix-system-condition.cc.
References m_cond, m_mutex, and NS_LOG_FUNCTION.
| void ns3::SystemConditionPrivate::Broadcast | ( | void | ) |
Broadcast the condition.
Definition at line 150 of file unix-system-condition.cc.
References m_cond, m_mutex, and NS_LOG_FUNCTION.
Referenced by ns3::SystemCondition::Broadcast().
Here is the caller graph for this function:| bool ns3::SystemConditionPrivate::GetCondition | ( | void | ) |
Get the condition value.
Definition at line 133 of file unix-system-condition.cc.
References m_condition, and NS_LOG_FUNCTION.
Referenced by ns3::SystemCondition::GetCondition().
Here is the caller graph for this function:| void ns3::SystemConditionPrivate::SetCondition | ( | bool | condition | ) |
Set the condition.
| [in] | condition | The new condition value. |
Definition at line 126 of file unix-system-condition.cc.
References m_condition, and NS_LOG_FUNCTION.
Referenced by ns3::SystemCondition::SetCondition().
Here is the caller graph for this function:| void ns3::SystemConditionPrivate::Signal | ( | void | ) |
Signal the condition.
Definition at line 140 of file unix-system-condition.cc.
References m_cond, m_mutex, and NS_LOG_FUNCTION.
Referenced by ns3::SystemCondition::Signal().
Here is the caller graph for this function:| bool ns3::SystemConditionPrivate::TimedWait | ( | uint64_t | ns | ) |
Unset the condition, then wait for a limited amount of wall-clock time for another thread to set it with SetCondition.
| [in] | ns | Maximum time to wait, in ns. |
true if the condition timed out; false if the other thread set it. Definition at line 174 of file unix-system-condition.cc.
References m_cond, m_condition, m_mutex, NS_LOG_FUNCTION, and NS_PER_SEC.
Referenced by ns3::SystemCondition::TimedWait().
Here is the caller graph for this function:| void ns3::SystemConditionPrivate::Wait | ( | void | ) |
Unset the condition, then wait for another thread to set it with SetCondition.
Definition at line 160 of file unix-system-condition.cc.
References m_cond, m_condition, m_mutex, and NS_LOG_FUNCTION.
Referenced by ns3::SystemCondition::Wait().
Here is the caller graph for this function:
|
private |
The pthread condition variable.
Definition at line 88 of file unix-system-condition.cc.
Referenced by SystemConditionPrivate(), ~SystemConditionPrivate(), Broadcast(), Signal(), TimedWait(), and Wait().
|
private |
The condition state.
Definition at line 90 of file unix-system-condition.cc.
Referenced by SystemConditionPrivate(), GetCondition(), SetCondition(), TimedWait(), and Wait().
|
private |
Mutex controlling access to the condition.
Definition at line 86 of file unix-system-condition.cc.
Referenced by SystemConditionPrivate(), ~SystemConditionPrivate(), Broadcast(), Signal(), TimedWait(), and Wait().
|
static |
Conversion from ns to s.
Definition at line 47 of file unix-system-condition.cc.
Referenced by TimedWait().