CARMA C++
carma::util::Sleeper Class Reference

Abstract base class for PthreadCond::TimedWait based sleeping with quit/interuption support. More...

#include <carma/util/Sleeper.h>

Public Member Functions

void interruptPresentOrNextWait ()
 Interrupt the wait that is presently occurring on this instance or if no such wait is presently occurring then preemptively interrupt the next wait that occurs. More...
 
void waitForWholeSecDuration (const int duration)
 
void waitUntilAbsTime (const struct::timespec &absTime)
 
void waitUntilAbsTime (const struct::timeval &absTime)
 

Detailed Description

Abstract base class for PthreadCond::TimedWait based sleeping with quit/interuption support.

Instances of Sleeper are only intended to be used from a single thread. The Sleeper is undefined if multiple threads attempt to wait on the same ScheduledTimer instance. It is however, safe to have multiple threads waiting on distinct Sleeper instances. Insert your favourite Woody Allen joke here. "If you want to make God laugh, tell him your future plans."

Definition at line 23 of file Sleeper.h.

Member Function Documentation

void carma::util::Sleeper::interruptPresentOrNextWait ( )

Interrupt the wait that is presently occurring on this instance or if no such wait is presently occurring then preemptively interrupt the next wait that occurs.

This is the one method that can be called by any thread other than the owning thread of the instance.


The documentation for this class was generated from the following file: