#include <Condition.h>
Public Methods | |
Condition () | |
Condition (const Condition &c) | |
~Condition () | |
int | wait () |
int | wait (Mutex *mutex) |
int | timedWait (Mutex *mutex, const struct timespec *timeToWait) |
bool | timedWait (Mutex *mutex, int milli) |
int | broadcast () |
int | signal () |
Protected Attributes | |
pthread_cond_t | m_condition |
Definition at line 15 of file Condition.h.
|
Create and initialize a pthread condition variable. Definition at line 21 of file Condition.h. |
|
Copy a pthread condition variable. Definition at line 29 of file Condition.h. |
|
Destory the pthread condition variable. Definition at line 37 of file Condition.h. |
|
A wrapper around pthread_cond_broadcast(). Definition at line 94 of file Condition.h. Referenced by LinkLayerInterface::accept(), LinkLayerInterface::connect(), and LinkLayerInterface::handleEvent().
|
|
A wrapper around pthread_cond_signal(). Definition at line 102 of file Condition.h. Referenced by ThreadMessageQueue::add(), PriorityPacketQueue::add(), ReceiveWindow::addReceive(), ReceiveWindow::close(), LinkLayerInterface::closeLink(), ReceiveWindow::destroy(), SendWindow::end(), ReceiveWindow::getNext(), PriorityPacketQueue::getNext(), SendWindow::onAckRecvd(), SendWindow::reliableSend(), ServiceEntry::signalConnectComplete(), ServiceEntry::signalDisconnect(), LiveBroadcastTable::~LiveBroadcastTable(), NetworkLayer::~NetworkLayer(), and PriorityPacketQueue::~PriorityPacketQueue().
|
|
A convenience function. This calls pthread_cond_timedwait with the delay specified in milliseconds. Warning: if the mutex is NOT locked before you call this function, it will return immediately. The mutex MUST be locked!!!
Definition at line 84 of file Condition.h. |
|
A wrapper around pthread_cond_timedwait(). Definition at line 67 of file Condition.h. Referenced by ReceiveWindow::destroy(), NetworkLayer::discoveryThreadImpl(), SendWindow::end(), NetworkLayer::pingThreadImpl(), SendWindow::reliableSend(), Timer::timerThreadImpl(), ServiceEntry::waitForConnectComplete(), ServiceEntry::waitForDisconnect(), and PriorityPacketQueue::~PriorityPacketQueue().
|
|
A wrapper around pthread_cond_wait(). Definition at line 59 of file Condition.h. |
|
Wait on the specified condition variable to be signalled. Use this when you dont care about locking or unlocking a mutex along with the condition variable. Returns only when the variable has been signalled. Definition at line 49 of file Condition.h. Referenced by ThreadMessageQueue::getNext(), ReceiveWindow::getNext(), PriorityPacketQueue::getNext(), LinkLayerInterface::listenImpl(), LinkLayerInterface::peerConnectImpl(), LinkLayerInterface::pollAllSocketsImpl(), and Timer::timerThreadImpl().
|
|
Definition at line 107 of file Condition.h. |