From e343acdd57e141387cb5173cedfde07241f9e2d1 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 9 Jan 2002 00:57:23 +0000 Subject: [PATCH] dont allow local PVs to connect unless the client ctx allows preemptive callback --- src/db/dbPutNotifyBlocker.cpp | 7 +++---- src/db/dbServiceIO.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index 2bc497194..6c76eae48 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -101,15 +101,14 @@ extern "C" void putNotifyCompletion ( putNotify *ppn ) else { errlogPrintf ( "put notify completion with nill pNotify?\n" ); } - // no need to lock here because only one put notify at a timeis lalowed to run + // no need to lock here because only one put notify at a time is lalowed to run memset ( &pBlocker->pn, '\0', sizeof ( pBlocker->pn ) ); pBlocker->pNotify = 0; pBlocker->block.signal (); } -void dbPutNotifyBlocker::initiatePutNotify ( epicsMutex &mutex, cacWriteNotify ¬ify, - struct dbAddr &addr, unsigned type, unsigned long count, - const void *pValue ) +void dbPutNotifyBlocker::initiatePutNotify ( epicsMutex &mutex, cacWriteNotify & notify, + struct dbAddr & addr, unsigned type, unsigned long count, const void * pValue ) { int status; diff --git a/src/db/dbServiceIO.cpp b/src/db/dbServiceIO.cpp index 557ef7ad5..ac3b24549 100644 --- a/src/db/dbServiceIO.cpp +++ b/src/db/dbServiceIO.cpp @@ -90,6 +90,12 @@ cacChannel *dbServiceIO::createChannel ( if ( status ) { return 0; } + else if ( ! ca_preemtive_callback_is_enabled () ) { + errlogPrintf ( + "dbServiceIO: preemptive callback required for + \n memory interfacing of CA channels to the DB\n" ); + return 0; + } else { return new dbChannelIO ( notify, addr, *this ); }