diff --git a/src/ca/comQueRecv.cpp b/src/ca/comQueRecv.cpp index de4ed772d..ac503aeaa 100644 --- a/src/ca/comQueRecv.cpp +++ b/src/ca/comQueRecv.cpp @@ -51,7 +51,7 @@ unsigned comQueRecv::occupiedBytes () const // copyIn ( comBuf & bufIn ) nBytes = this->bufs.first ()->occupiedBytes (); nBytes += this->bufs.last ()->occupiedBytes (); - nBytes += ( count - 2u ) * comBuf::maxBytes (); + nBytes += ( count - 2u ) * comBuf::capacityBytes (); } return nBytes; diff --git a/src/ca/comQueSend.cpp b/src/ca/comQueSend.cpp index 08183042d..a26a9b4ac 100644 --- a/src/ca/comQueSend.cpp +++ b/src/ca/comQueSend.cpp @@ -37,7 +37,7 @@ // // Implementation: // 1) When queuing a complete message, first test to see if a flush is -// required. If it is a receive thread schedual the flush with the +// required. If it is a receive thread scheduals the flush with the // send thread, and otherwise directly execute the system call. The // send thread must run at a higher priority than the receive thread // if we are to minimize memory consumption. @@ -61,6 +61,7 @@ #include "comQueSend_IL.h" tsFreeList < class comBuf, 0x20 > comBuf::freeList; +epicsMutex comBuf::freeListMutex; comQueSend::comQueSend ( wireSendAdapter & wireIn ) : wire ( wireIn ), nBytesPending ( 0u ) @@ -102,7 +103,7 @@ int comQueSend::reserveSpace ( unsigned msgSize ) while ( bytesReserved < msgSize ) { if ( reservoir.addOneBuffer () ) { - bytesReserved += comBuf::maxBytes (); + bytesReserved += comBuf::capacityBytes (); } else { return ECA_ALLOCMEM; diff --git a/src/ca/comQueSend_IL.h b/src/ca/comQueSend_IL.h index 36fe46608..df44b0e7c 100644 --- a/src/ca/comQueSend_IL.h +++ b/src/ca/comQueSend_IL.h @@ -44,7 +44,7 @@ inline bool bufferReservoir::addOneBuffer () inline unsigned bufferReservoir::nBytes () { - return ( this->reservedBufs.count () * comBuf::maxBytes () ); + return ( this->reservedBufs.count () * comBuf::capacityBytes () ); } inline void bufferReservoir::drain () @@ -181,7 +181,7 @@ inline unsigned comQueSend::occupiedBytes () const inline bool comQueSend::flushThreshold ( unsigned nBytesThisMsg ) const { - return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::maxBytes () ); + return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::capacityBytes () ); } inline comBuf * comQueSend::popNextComBufToSend ()