libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::ChildLocker Class Reference

#include <MarshallerThread.h>

Public Member Functions

 ChildLocker (pthread_mutex_t &lock, pthread_cond_t &cond, int &count)
 

Detailed Description

Synchronization for the child thread in the multi-threaded version of the DAP2 and DAP4 (when it gets implemented) 'Marshaller' class used to send data. The class declared below (MarshallerThread) manages the child thread.

The ctor of this class simply locks the mutex; the dtor clears the child thread count, signals that count has changed and unlocks the mutex.

Definition at line 74 of file MarshallerThread.h.

Constructor & Destructor Documentation

◆ ChildLocker()

ChildLocker::ChildLocker ( pthread_mutex_t &  lock,
pthread_cond_t &  cond,
int &  count 
)

Lock the mutex, but do not wait on the condition variable. This is used by the child thread; it helps ensure that the mutex is unlocked and the predicate is reset no matter how the child thread is exited.

Note we how a reference to the shared 'count' predicate that tells how many (0 or 1) child threads exist so that when this version of the Locker object is destroyed, we can zero that. This enables us to use RAII in the child thread and ensure the invariant if there is an error and the code exits with a summary return.

Definition at line 133 of file MarshallerThread.cc.


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