OpenDDS::RTPS::WaitForAcks Class Reference

A class to wait on acknowledgments from other threads. More...

#include <Sedp.h>

List of all members.

Public Member Functions

 WaitForAcks ()
void ack ()
void wait_for_acks (unsigned int num_acks)
void reset ()

Private Attributes

ACE_Thread_Mutex lock_
ACE_Condition_Thread_Mutex cond_
unsigned int acks_


Detailed Description

A class to wait on acknowledgments from other threads.

Definition at line 379 of file Sedp.h.


Constructor & Destructor Documentation

OpenDDS::RTPS::WaitForAcks::WaitForAcks (  ) 

Definition at line 2185 of file Sedp.cpp.

02186 : cond_(lock_)
02187 , acks_(0)
02188 {
02189 }


Member Function Documentation

void OpenDDS::RTPS::WaitForAcks::ack (  ) 

Definition at line 2192 of file Sedp.cpp.

References acks_, cond_, and lock_.

Referenced by OpenDDS::RTPS::Spdp::SpdpTransport::handle_exception(), and OpenDDS::RTPS::Sedp::Task::svc().

02193 {
02194   {
02195     ACE_GUARD(ACE_Thread_Mutex, g, lock_);
02196     ++acks_;
02197   }
02198   cond_.signal();
02199 }

void OpenDDS::RTPS::WaitForAcks::reset (  ) 

Definition at line 2211 of file Sedp.cpp.

References acks_, and lock_.

Referenced by OpenDDS::RTPS::Spdp::fini_bit().

02212 {
02213   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
02214   acks_ = 0;
02215   // no need to signal, going back to zero won't ever
02216   // cause wait_for_acks() to exit it's loop
02217 }

void OpenDDS::RTPS::WaitForAcks::wait_for_acks ( unsigned int  num_acks  ) 

Definition at line 2202 of file Sedp.cpp.

References acks_, cond_, and lock_.

Referenced by OpenDDS::RTPS::Spdp::fini_bit().

02203 {
02204   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
02205   while (num_acks > acks_) {
02206     cond_.wait();
02207   }
02208 }


Member Data Documentation

unsigned int OpenDDS::RTPS::WaitForAcks::acks_ [private]

Definition at line 388 of file Sedp.h.

Referenced by ack(), reset(), and wait_for_acks().

ACE_Condition_Thread_Mutex OpenDDS::RTPS::WaitForAcks::cond_ [private]

Definition at line 387 of file Sedp.h.

Referenced by ack(), and wait_for_acks().

ACE_Thread_Mutex OpenDDS::RTPS::WaitForAcks::lock_ [private]

Definition at line 386 of file Sedp.h.

Referenced by ack(), reset(), and wait_for_acks().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:50 2016 for OpenDDS by  doxygen 1.4.7