libdap  Updated for version 3.17.0
libdap::ChildLocker Class Reference

#include <MarshallerThread.h>

List of all members.

Public Member Functions

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

Detailed Description

RAII (for MarshallerThread) used by the child thread. The ctor simply locks the mutex; the dtor clears the child thread count, signals that count has changed and unlocks the mutex.

Definition at line 69 of file MarshallerThread.h.


Constructor & Destructor Documentation

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 127 of file MarshallerThread.cc.


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