This is Unofficial EPICS BASE Doxygen Site
pvac::detail::CallbackGuard Struct Reference

#include "clientpvt.h"

+ Collaboration diagram for pvac::detail::CallbackGuard:

Public Member Functions

 CallbackGuard (CallbackStorage &store)
 
 ~CallbackGuard ()
 
void ensureself ()
 
void wait ()
 

Public Attributes

CallbackStoragestore
 
epicsThreadId self
 

Detailed Description

Definition at line 126 of file clientpvt.h.

Constructor & Destructor Documentation

pvac::detail::CallbackGuard::CallbackGuard ( CallbackStorage store)
inlineexplicit

Definition at line 129 of file clientpvt.h.

129  :store(store), self(0) {
130  store.mutex.lock();
131  }
CallbackStorage & store
Definition: clientpvt.h:127
pvac::detail::CallbackGuard::~CallbackGuard ( )
inline

Definition at line 132 of file clientpvt.h.

132  {
133  bool notify = store.nwaitcb!=0;
134  store.mutex.unlock();
135  if(notify)
136  store.wakeup.signal();
137  }
CallbackStorage & store
Definition: clientpvt.h:127

Member Function Documentation

void pvac::detail::CallbackGuard::ensureself ( )
inline

Definition at line 138 of file clientpvt.h.

138  {
139  if(!self)
140  self = epicsThreadGetIdSelf();
141  }
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)
Definition: osdThread.c:810
void pvac::detail::CallbackGuard::wait ( )
inline

Definition at line 143 of file clientpvt.h.

143  {
144  if(!store.incb) return;
145  ensureself();
146  store.nwaitcb++;
147  while(store.incb && store.incb!=self) {
148  store.mutex.unlock();
149  store.wakeup.wait();
150  store.mutex.lock();
151  }
152  store.nwaitcb--;
153  }
CallbackStorage & store
Definition: clientpvt.h:127

Member Data Documentation

epicsThreadId pvac::detail::CallbackGuard::self

Definition at line 128 of file clientpvt.h.

CallbackStorage& pvac::detail::CallbackGuard::store

Definition at line 127 of file clientpvt.h.


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