From 0504af338bb9d86f8b5c9d468af7b087f353f61c Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 30 May 2001 21:56:30 +0000 Subject: [PATCH] restored ca_pend() --- src/ca/access.cpp | 10 ++++++++++ src/ca/acctst.c | 13 +++++++++++++ src/ca/cadef.h | 5 ++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/ca/access.cpp b/src/ca/access.cpp index 28e3bcf96..ce959d5e0 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -595,6 +595,16 @@ extern "C" chid epicsShareAPI ca_evid_to_chid ( evid pMon ) return & pMon->channel (); } +extern "C" int epicsShareAPI ca_pend ( ca_real timeout, int early ) +{ + if ( early ) { + return ca_pend_io ( timeout ); + } + else { + return ca_pend_event ( timeout ); + } +} + /* * ca_pend_event () */ diff --git a/src/ca/acctst.c b/src/ca/acctst.c index a8ec9e8ff..d63fb8627 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -1668,6 +1668,18 @@ void verifyReasonableBeaconPeriod ( chid chan ) } } +void verifyOldPend () +{ + int status; + /* + * at least verify that the old ca_pend() is in the symbol table + */ + status = ca_pend ( 100000.0, TRUE ); + assert ( status = ECA_NORMAL ); + status = ca_pend ( 1e-12, FALSE ); + assert ( status = ECA_TIMEOUT ); +} + int acctst ( char *pName, unsigned channelCount, unsigned repetitionCount ) { chid chan; @@ -1697,6 +1709,7 @@ int acctst ( char *pName, unsigned channelCount, unsigned repetitionCount ) printf ( "testing with a local channel\n" ); } + verifyOldPend (); arrayTest ( chan ); verifyMonitorSubscriptionFlushIO ( chan ); monitorSubscriptionFirstUpdateTest ( chan ); diff --git a/src/ca/cadef.h b/src/ca/cadef.h index 25d65908f..2d94b83f7 100644 --- a/src/ca/cadef.h +++ b/src/ca/cadef.h @@ -637,7 +637,7 @@ epicsShareFunc int epicsShareAPI ca_clear_event /************************************************************************/ /************************************************************************/ -/* This routine pends waiting for channel events and calls the */ +/* These routines wait for channel subscription events and call the */ /* functions specified with add_event when events occur. If the */ /* timeout is specified as 0 an infinite timeout is assumed. */ /* ca_flush_io() is called by this routine. If ca_pend_io () */ @@ -662,6 +662,9 @@ epicsShareFunc int epicsShareAPI ca_pend_event (ca_real timeOut); */ epicsShareFunc int epicsShareAPI ca_pend_io (ca_real timeOut); +/* calls ca_pend_io() if early is true otherwise ca_pend_event() is called */ +epicsShareFunc int epicsShareAPI ca_pend (ca_real timeout, int early); + /* * ca_test_io() *