changed loc of free list lock

This commit is contained in:
Jeff Hill
2001-03-07 16:27:09 +00:00
parent 922dece548
commit 00ec5cbdeb
7 changed files with 18 additions and 20 deletions

View File

@@ -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 );
}

View File

@@ -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;

View File

@@ -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 );
}

View File

@@ -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 );
}

View File

@@ -14,6 +14,7 @@
#include "oldAccess.h"
tsFreeList < struct oldSubscription, 1024 > oldSubscription::freeList;
epicsMutex oldSubscription::freeListMutex;
oldSubscription::~oldSubscription ()
{

View File

@@ -19,6 +19,7 @@
#include "oldAccess.h"
tsFreeList < class putCallback, 1024 > putCallback::freeList;
epicsMutex putCallback::freeListMutex;
putCallback::~putCallback ()
{

View File

@@ -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 );
}