switch remaining to use REFCOUNT macros

This commit is contained in:
Michael Davidsaver
2011-01-30 18:09:39 -05:00
parent 099215986f
commit 4a65bf9342
11 changed files with 52 additions and 445 deletions

View File

@@ -24,50 +24,20 @@
namespace epics { namespace pvData {
static Mutex globalMutex;
static volatile int64 totalConstruct = 0;
static volatile int64 totalDestruct = 0;
static bool notInited = true;
PVDATA_REFCOUNT_MONITOR_DEFINE(event);
static String alreadyOn("already on list");
static int64 getTotalConstruct()
{
Lock xx(&globalMutex);
return totalConstruct;
}
static int64 getTotalDestruct()
{
Lock xx(&globalMutex);
return totalDestruct;
}
static void init()
{
Lock xx(&globalMutex);
if(notInited) {
notInited = false;
ShowConstructDestruct::registerCallback(
String("event"),
getTotalConstruct,getTotalDestruct,0,0);
}
}
Event::~Event() {
epicsEventDestroy(id);
id = 0;
Lock xx(&globalMutex);
totalDestruct++;
PVDATA_REFCOUNT_MONITOR_DESTRUCT(event);
}
Event::Event(bool full)
: id(epicsEventCreate(full?epicsEventFull : epicsEventEmpty))
{
init();
Lock xx(&globalMutex);
totalConstruct++;
PVDATA_REFCOUNT_MONITOR_CONSTRUCT(event);
}
void Event::signal()