changed loc of free list lock
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
|
||||
inline void * netReadNotifyIO::operator new ( size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netReadNotifyIO::freeListMutex );
|
||||
return netReadNotifyIO::freeList.allocate ( size );
|
||||
}
|
||||
|
||||
inline void netReadNotifyIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netReadNotifyIO::freeListMutex );
|
||||
netReadNotifyIO::freeList.release ( pCadaver, size );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,27 +20,21 @@
|
||||
|
||||
inline void * netSubscription::operator new ( size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netSubscription::freeListMutex );
|
||||
return netSubscription::freeList.allocate ( size );
|
||||
}
|
||||
|
||||
inline void netSubscription::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netSubscription::freeListMutex );
|
||||
netSubscription::freeList.release ( pCadaver, size );
|
||||
}
|
||||
|
||||
inline unsigned long netSubscription::getCount () const
|
||||
{
|
||||
if ( this->chan.connected () ) {
|
||||
unsigned long nativeCount = chan.nativeElementCount ();
|
||||
if ( this->count == 0u ) {
|
||||
return nativeCount;
|
||||
}
|
||||
else if ( this->count > nativeCount ) {
|
||||
return nativeCount;
|
||||
}
|
||||
else {
|
||||
return this->count;
|
||||
}
|
||||
unsigned long nativeCount = chan.nativeElementCount ();
|
||||
if ( this->count == 0u || this->count > nativeCount ) {
|
||||
return nativeCount;
|
||||
}
|
||||
else {
|
||||
return this->count;
|
||||
|
||||
@@ -15,16 +15,15 @@
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
//
|
||||
// netWriteNotifyIO inline member functions
|
||||
//
|
||||
inline void * netWriteNotifyIO::operator new ( size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netWriteNotifyIO::freeListMutex );
|
||||
return netWriteNotifyIO::freeList.allocate ( size );
|
||||
}
|
||||
|
||||
inline void netWriteNotifyIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( netWriteNotifyIO::freeListMutex );
|
||||
netWriteNotifyIO::freeList.release ( pCadaver, size );
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "oldAccess.h"
|
||||
|
||||
tsFreeList < class oldChannelNotify, 1024 > oldChannelNotify::freeList;
|
||||
epicsMutex oldChannelNotify::freeListMutex;
|
||||
|
||||
extern "C" void cacNoopConnHandler ( struct connection_handler_args )
|
||||
{
|
||||
@@ -115,10 +116,12 @@ class oldChannelNotify * oldChannelNotify::pOldChannelNotify ()
|
||||
|
||||
void * oldChannelNotify::operator new ( size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( oldChannelNotify::freeListMutex );
|
||||
return oldChannelNotify::freeList.allocate ( size );
|
||||
}
|
||||
|
||||
void oldChannelNotify::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( oldChannelNotify::freeListMutex );
|
||||
oldChannelNotify::freeList.release ( pCadaver, size );
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "oldAccess.h"
|
||||
|
||||
tsFreeList < struct oldSubscription, 1024 > oldSubscription::freeList;
|
||||
epicsMutex oldSubscription::freeListMutex;
|
||||
|
||||
oldSubscription::~oldSubscription ()
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "oldAccess.h"
|
||||
|
||||
tsFreeList < class putCallback, 1024 > putCallback::freeList;
|
||||
epicsMutex putCallback::freeListMutex;
|
||||
|
||||
putCallback::~putCallback ()
|
||||
{
|
||||
|
||||
@@ -57,12 +57,6 @@
|
||||
#include "iocinf.h"
|
||||
#include "taskwd.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
# define debugPrintf(argsInParen) printf argsInParen
|
||||
#else
|
||||
# define debugPrintf(argsInParen)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* one socket per client so we will get the ECONNREFUSED
|
||||
* error code (and then delete the client)
|
||||
@@ -86,6 +80,7 @@ private:
|
||||
SOCKET sock;
|
||||
unsigned port () const;
|
||||
static tsFreeList < class repeaterClient, 0x20 > freeList;
|
||||
static epicsMutex freeListMutex;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -94,6 +89,7 @@ private:
|
||||
*/
|
||||
static tsDLList < repeaterClient > client_list;
|
||||
tsFreeList < repeaterClient, 0x20 > repeaterClient::freeList;
|
||||
epicsMutex repeaterClient::freeListMutex;
|
||||
|
||||
static char buf [MAX_UDP_RECV];
|
||||
|
||||
@@ -246,11 +242,13 @@ repeaterClient::~repeaterClient ()
|
||||
|
||||
inline void * repeaterClient::operator new ( size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( repeaterClient::freeListMutex );
|
||||
return repeaterClient::freeList.allocate ( size );
|
||||
}
|
||||
|
||||
inline void repeaterClient::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
epicsAutoMutex locker ( repeaterClient::freeListMutex );
|
||||
repeaterClient::freeList.release ( pCadaver, size );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user