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

#include <MarshallerThread.h>

Collaboration diagram for libdap::ChildLocker:
Collaboration graph

Public Member Functions

 ChildLocker ()=delete
 
 ChildLocker (const Locker &rhs)=delete
 
 ChildLocker (pthread_mutex_t &lock, pthread_cond_t &cond, int &count)
 
virtual ~ChildLocker ()
 

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() [1/3]

libdap::ChildLocker::ChildLocker ( )
delete

◆ ChildLocker() [2/3]

libdap::ChildLocker::ChildLocker ( const Locker & rhs)
delete

◆ ChildLocker() [3/3]

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

◆ ~ChildLocker()

ChildLocker::~ChildLocker ( )
virtual

Definition at line 140 of file MarshallerThread.cc.


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