IBR-DTNSuite
0.12
|
#include <Conditional.h>
Classes | |
class | ConditionalAbortException |
Public Member Functions | |
Conditional () | |
virtual | ~Conditional () |
void | signal (bool broadcast=false) throw () |
void | wait (size_t timeout=0) throw (ConditionalAbortException) |
void | wait (struct timespec *ts) throw (ConditionalAbortException) |
void | abort () throw () |
void | reset () throw () |
Public Member Functions inherited from ibrcommon::Mutex | |
Mutex (MUTEX_TYPE type=MUTEX_NORMAL) | |
virtual | ~Mutex () |
virtual void | trylock () throw (MutexException) |
virtual void | enter () throw (MutexException) |
virtual void | leave () throw (MutexException) |
Public Member Functions inherited from ibrcommon::MutexInterface | |
virtual | ~MutexInterface ()=0 |
Static Public Member Functions | |
static void | gettimeout (size_t timeout, struct timespec *hires) throw () |
Static Public Member Functions inherited from ibrcommon::Mutex | |
static MutexInterface & | dummy () |
Additional Inherited Members | |
Public Types inherited from ibrcommon::Mutex | |
enum | MUTEX_TYPE { MUTEX_NORMAL = PTHREAD_MUTEX_NORMAL, MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE, MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK } |
Protected Attributes inherited from ibrcommon::Mutex | |
pthread_mutex_t | m_mutex |
pthread_mutexattr_t | m_attr |
Definition at line 33 of file Conditional.h.
ibrcommon::Conditional::Conditional | ( | ) |
Definition at line 36 of file Conditional.cpp.
|
virtual |
Definition at line 41 of file Conditional.cpp.
void ibrcommon::Conditional::abort | ( | ) | ||
throw | ( | |||
) |
Abort all waits on this conditional.
Definition at line 154 of file Conditional.cpp.
References signal().
Referenced by dtn::api::Registration::abort(), ibrcommon::Queue< dtn::net::BundleTransfer >::abort(), dtn::core::EventSwitch::componentDown(), dtn::net::DatagramConnection::finally(), and term().
|
static |
Convert a millisecond timeout into use for high resolution conditional timers.
timeout | to convert. |
hires | timespec representation to fill. |
Definition at line 132 of file Conditional.cpp.
Referenced by ibrcommon::Queue< dtn::net::BundleTransfer >::__wait().
void ibrcommon::Conditional::reset | ( | ) | ||
throw | ( | |||
) |
Removes the abort call off this conditional.
Definition at line 165 of file Conditional.cpp.
Referenced by ibrcommon::Queue< dtn::net::BundleTransfer >::__wait(), dtn::core::EventSwitch::componentUp(), dtn::api::Registration::detach(), and ibrcommon::Queue< dtn::net::BundleTransfer >::reset().
void ibrcommon::Conditional::signal | ( | bool | broadcast = false ) | ||
throw | ( | ||||
) |
Definition at line 58 of file Conditional.cpp.
Referenced by ibrcommon::LinkMonitor::__cancellation(), ibrcommon::Queue< dtn::net::BundleTransfer >::__pop(), ibrcommon::Queue< dtn::net::BundleTransfer >::__push(), ibrcommon::stopandwait::__recv(), ibrcommon::lowpanstream::abort(), abort(), dtn::net::DatagramConnection::ack(), dtn::net::DatagramConvergenceLayer::componentRun(), ibrcommon::iobuffer::finalize(), func_sighandler(), ibrdtn_daemon_shutdown(), dtn::api::Registration::notify(), dtn::net::TCPConvergenceLayer::open(), ibrcommon::AtomicCounter::operator++(), ibrcommon::AtomicCounter::operator--(), ibrcommon::ThreadsafeState< THREAD_STATE >::operator=(), ibrcommon::iobuffer::overflow(), ibrcommon::Queue< dtn::net::BundleTransfer >::push(), ibrcommon::lowpanstream::queue(), dtn::net::TCPConvergenceLayer::queue(), dtn::core::EventSwitch::queue(), BundleStreamBuf::received(), ibrcommon::StatefulConditional< ibrcommon::Timer::TIMER_STATE, TIMER_STOPPED >::setState(), dtn::core::EventSwitch::shutdown(), sighandler_func(), dtn::core::WallClock::timeout(), ibrcommon::AtomicCounter::unblockAll(), ibrcommon::iobuffer::underflow(), ibrcommon::lowpanstream::underflow(), and ibrcommon::ThreadsafeState< THREAD_STATE >::~ThreadsafeState().
void ibrcommon::Conditional::wait | ( | size_t | timeout = 0 ) | ||
throw | ( | ConditionalAbortException | |||
) |
Definition at line 71 of file Conditional.cpp.
Referenced by __daemon_run(), ibrcommon::stopandwait::__send(), BundleStreamBuf::__underflow(), ibrcommon::Queue< dtn::net::BundleTransfer >::__wait(), ibrcommon::lowpanstream::abort(), dtn::core::EventSwitch::componentDown(), dtn::net::TCPConvergenceLayer::componentDown(), main(), ibrcommon::iobuffer::overflow(), ibrcommon::lowpanstream::queue(), ibrcommon::LinkMonitor::run(), ServiceMain(), dtn::core::WallClock::sync(), ibrcommon::iobuffer::underflow(), ibrcommon::lowpanstream::underflow(), ibrcommon::AtomicCounter::wait(), dtn::api::Registration::wait_for_bundle(), ibrcommon::StatefulConditional< ibrcommon::Timer::TIMER_STATE, TIMER_STOPPED >::waitState(), and dtn::net::DatagramConvergenceLayer::~DatagramConvergenceLayer().
void ibrcommon::Conditional::wait | ( | struct timespec * | ts) | ||
throw | ( | ConditionalAbortException | |||
) |
Definition at line 94 of file Conditional.cpp.