use auto_ptr instead of epics_auto_ptr where applicable

This commit is contained in:
Michael Davidsaver
2016-04-28 09:20:13 -04:00
parent 79f1257f1d
commit 05c347434b
3 changed files with 9 additions and 5 deletions

View File

@@ -159,13 +159,13 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
this->localPort = htons ( tmpAddr.ia.sin_port );
}
epics_auto_ptr < CallbackGuard > pCBGuard;
std::auto_ptr < CallbackGuard > pCBGuard;
if ( ! enablePreemptiveCallback ) {
pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) );
}
// multiple steps ensure exception safety
this->pCallbackGuard = pCBGuard;
std::swap(this->pCallbackGuard, pCBGuard);
}
ca_client_context::~ca_client_context ()

View File

@@ -26,6 +26,8 @@
#ifndef oldAccessh
#define oldAccessh
#include <memory>
#ifdef epicsExportSharedSymbols
# define oldAccessh_restore_epicsExportSharedSymbols
# undef epicsExportSharedSymbols
@@ -402,8 +404,8 @@ private:
epicsEvent ioDone;
epicsEvent callbackThreadActivityComplete;
epicsThreadId createdByThread;
epics_auto_ptr < CallbackGuard > pCallbackGuard;
epics_auto_ptr < cacContext > pServiceContext;
std::auto_ptr < CallbackGuard > pCallbackGuard;
std::auto_ptr < cacContext > pServiceContext;
caExceptionHandler * ca_exception_func;
void * ca_exception_arg;
caPrintfFunc * pVPrintfFunc;

View File

@@ -36,6 +36,8 @@
#include "stdlib.h"
#include <memory> // std::auto_ptr
#include "tsDLList.h"
#include "tsFreeList.h"
#include "resourceLib.h"
@@ -203,7 +205,7 @@ private:
epicsMutex & mutex;
epicsMutex & cbMutex;
cacContextNotify & notify;
epics_auto_ptr < cacContext > pNetContext;
std::auto_ptr < cacContext > pNetContext;
char * pStateNotifyCache;
bool isolated;