From a29b0fafc721694a52d1e4ff0ecad01a51ca3404 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 12 Jul 2001 23:57:24 +0000 Subject: [PATCH] changed name of constant and added block until recv backlog is complete to pend_event --- src/ca/CASG.cpp | 2 +- src/ca/cac.cpp | 13 ++++++++----- src/ca/iocinf.h | 7 +++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ca/CASG.cpp b/src/ca/CASG.cpp index ed0093404..3b5035498 100644 --- a/src/ca/CASG.cpp +++ b/src/ca/CASG.cpp @@ -95,7 +95,7 @@ int CASG::block ( double timeout ) } remaining = timeout - delay; - if ( remaining <= CAC_SIGNIFICANT_SELECT_DELAY ) { + if ( remaining <= CAC_SIGNIFICANT_DELAY ) { /* * Make sure that we take care of * recv backlog at least once diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index 9461b79b4..2cf223a0f 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -538,7 +538,7 @@ int cac::pendIO ( const double &timeout ) this->flushRequestPrivate (); while ( this->pndRecvCnt > 0 ) { - if ( remaining < CAC_SIGNIFICANT_SELECT_DELAY ) { + if ( remaining < CAC_SIGNIFICANT_DELAY ) { status = ECA_TIMEOUT; break; } @@ -597,12 +597,15 @@ int cac::pendEvent ( const double &timeout ) epicsThreadSleep ( 60.0 ); } } - else if ( timeout >= CAC_SIGNIFICANT_SELECT_DELAY ) { + else if ( timeout >= CAC_SIGNIFICANT_DELAY ) { epicsThreadSleep ( timeout ); } - // give up the processor if there is recv processing to be done - else if ( this->recvProcessPending ) { - epicsThreadSleep ( timeout ); + else { + // give up the processor while + // there is recv processing to be done + while ( this->recvProcessPending ) { + epicsThreadSleep ( CAC_SIGNIFICANT_DELAY ); + } } } diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h index bd842fca1..9c6770f59 100644 --- a/src/ca/iocinf.h +++ b/src/ca/iocinf.h @@ -39,11 +39,10 @@ #define USEC_PER_SEC 1000000L -#if defined (CLOCKS_PER_SEC) -# define CAC_SIGNIFICANT_SELECT_DELAY ( 1.0 / CLOCKS_PER_SEC ) +#if defined ( CLOCKS_PER_SEC ) +# define CAC_SIGNIFICANT_DELAY ( 1.0 / CLOCKS_PER_SEC ) #else -/* on sunos4 GNU does not provide CLOCKS_PER_SEC */ -# define CAC_SIGNIFICANT_SELECT_DELAY (1.0 / 1000000u) +# define CAC_SIGNIFICANT_DELAY (1.0 / 1000000u) #endif /*