19 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 28 PRecycleFunc pRecycleFuncIn,
chid pChan ) :
29 chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
30 sg ( sgIn ), magic ( CASG_MAGIC ),
31 id ( 0u ), idIsValid (
false ), ioComplete (
false )
40 this->ioComplete =
false;
42 this->chan->
write ( guard, type, count,
43 pValueIn, *
this, &this->
id );
51 if ( this->idIsValid ) {
52 this->chan->
ioCancel ( callbackGuard, mutualExcusionGuard, this->
id );
53 this->idIsValid =
false;
68 CASG & sgRef ( this->sg );
70 ( sgRef.*pRecycleFunc ) ( guard, *
this );
75 assert ( ! this->idIsValid );
81 if ( this->magic != CASG_MAGIC ) {
82 this->sg.
printFormated (
"cac: sync group io_complete(): bad sync grp op magic number?\n" );
86 this->idIsValid =
false;
87 this->ioComplete =
true;
90 void syncGroupWriteNotify::exception (
94 if ( this->magic != CASG_MAGIC ) {
95 this->sg.
printFormated (
"cac: sync group io_complete(): bad sync grp op magic number?\n" );
98 this->sg.exception ( guard, status, pContext,
99 __FILE__, __LINE__, *this->chan, type, count,
CA_OP_PUT );
100 this->idIsValid =
false;
111 ::printf (
"pending write sg op\n" );
113 ::printf (
"pending sg op: magic=%u sg=%p\n",
114 this->magic, static_cast < void * > ( &this->sg ) );
118 void syncGroupWriteNotify::operator
delete (
void * )
125 errlogPrintf (
"%s:%d this compiler is confused about placement delete - memory was probably leaked",
126 __FILE__, __LINE__ );
129 void * syncGroupWriteNotify::operator
new (
size_t size,
132 return freeList.allocate ( size );
135 #if defined ( CXX_PLACEMENT_DELETE ) 136 void syncGroupWriteNotify::operator
delete (
void *pCadaver,
139 freeList.release ( pCadaver );
void(CASG::* PRecycleFunc)(epicsGuard< epicsMutex > &, syncGroupWriteNotify &)
void cancel(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &guard)
#define assert(exp)
Declare that a condition should be true.
void destroy(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &guard)
virtual ~syncGroupWriteNotify()
static syncGroupWriteNotify * factory(tsFreeList< class syncGroupWriteNotify, 128, epicsMutexNOOP > &, CASG &, PRecycleFunc, chid)
void show(epicsGuard< epicsMutex > &, unsigned level) const
int errlogPrintf(const char *pFormat,...)
unsigned long arrayElementCount
void ioCancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const cacChannel::ioid &)
void write(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValue, cacWriteNotify &, cacChannel::ioid *pId=0)
int printFormated(const char *pFormat,...)
void completionNotify(epicsGuard< epicsMutex > &, syncGroupNotify &)
virtual void completion(epicsGuard< epicsMutex > &)=0
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
void begin(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pValueIn)
syncGroupWriteNotify(struct CASG &, PRecycleFunc, chid)