From 9940b408fb02c5369bf0b7698029850d5efdbf54 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 22 May 2001 02:02:41 +0000 Subject: [PATCH] made compatible with changes in service API --- src/db/dbChannelIO.cpp | 2 +- src/db/dbPutNotifyBlocker.cpp | 16 +++++++++++----- src/db/dbServiceIO.cpp | 2 +- src/db/dbSubscriptionIO.cpp | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/db/dbChannelIO.cpp b/src/db/dbChannelIO.cpp index c63aeee9f..0157c6a6a 100644 --- a/src/db/dbChannelIO.cpp +++ b/src/db/dbChannelIO.cpp @@ -102,7 +102,7 @@ void dbChannelIO::subscribe ( unsigned type, unsigned long count, new dbSubscriptionIO ( this->serviceIO, *this, this->addr, notify, type, count, mask, pId ); if ( ! pIO ) { - throw noMemory(); + throw std::bad_alloc (); } } diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index 0da80994a..978f5423c 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -72,11 +72,15 @@ extern "C" void putNotifyCompletion ( putNotify *ppn ) if ( pBlocker->pn.status ) { if ( pBlocker->pn.status == S_db_Blocked ) { pBlocker->pNotify->exception ( - ECA_PUTCBINPROG, "put notify blocked" ); + ECA_PUTCBINPROG, "put notify blocked", + static_cast (pBlocker->pn.dbrType), + static_cast (pBlocker->pn.nRequest) ); } else { pBlocker->pNotify->exception ( - ECA_PUTFAIL, "put notify unsuccessful"); + ECA_PUTFAIL, "put notify unsuccessful", + static_cast (pBlocker->pn.dbrType), + static_cast (pBlocker->pn.nRequest) ); } } else { @@ -122,7 +126,7 @@ void dbPutNotifyBlocker::initiatePutNotify ( epicsMutex &mutex, cacWriteNotify & beginTimeInit = true; } { - epicsAutoMutexRelease blocker ( mutex ); + epicsAutoMutexRelease autoRelease ( mutex ); this->block.wait ( 1.0 ); } } @@ -154,9 +158,11 @@ void dbPutNotifyBlocker::initiatePutNotify ( epicsMutex &mutex, cacWriteNotify & memset ( &this->pn, '\0', sizeof ( this->pn ) ); this->pNotify = 0; { - epicsAutoMutexRelease blocker ( mutex ); + epicsAutoMutexRelease autoRelease ( mutex ); notify.exception ( - ECA_PUTFAIL, "dbPutNotify() returned failure" ); + ECA_PUTFAIL, "dbPutNotify() returned failure", + static_cast (this->pn.dbrType), + static_cast (this->pn.nRequest) ); } } } diff --git a/src/db/dbServiceIO.cpp b/src/db/dbServiceIO.cpp index 03783dd31..2bfd3850e 100644 --- a/src/db/dbServiceIO.cpp +++ b/src/db/dbServiceIO.cpp @@ -252,7 +252,7 @@ void dbServiceIO::initiatePutNotify ( dbChannelIO &chan, struct dbAddr &addr, if ( ! chan.dbServicePrivateListOfIO::pBlocker ) { chan.dbServicePrivateListOfIO::pBlocker = new dbPutNotifyBlocker ( chan ); if ( ! chan.dbServicePrivateListOfIO::pBlocker ) { - throw cacChannel::noMemory(); + throw std::bad_alloc (); } this->ioTable.add ( *chan.dbServicePrivateListOfIO::pBlocker ); } diff --git a/src/db/dbSubscriptionIO.cpp b/src/db/dbSubscriptionIO.cpp index 64aece360..d5def6183 100644 --- a/src/db/dbSubscriptionIO.cpp +++ b/src/db/dbSubscriptionIO.cpp @@ -41,7 +41,7 @@ dbSubscriptionIO::dbSubscriptionIO ( dbServiceIO &serviceIO, dbChannelIO &chanIO { this->es = serviceIO.subscribe ( addr, chanIO, *this, maskIn, pId ); if ( ! this->es ) { - throw cacChannel::noMemory(); + throw std::bad_alloc (); } }