changed name of constant and added block until recv

backlog is complete to pend_event
This commit is contained in:
Jeff Hill
2001-07-12 23:57:24 +00:00
parent ef4ebf4d4b
commit a29b0fafc7
3 changed files with 12 additions and 10 deletions

View File

@@ -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

View File

@@ -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 );
}
}
}

View File

@@ -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
/*