From 8624be05d4c5c541894045b3a358bb083ae14416 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 22 Aug 1995 00:22:52 +0000 Subject: [PATCH] Dont wait for itsy bitsy delays to expire --- src/ca/syncgrp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ca/syncgrp.c b/src/ca/syncgrp.c index 378b8ec19..2cc3c5d05 100644 --- a/src/ca/syncgrp.c +++ b/src/ca/syncgrp.c @@ -261,9 +261,16 @@ int epicsShareAPI ca_sg_block(CA_SYNC_GID gid, ca_real timeout) /* * Exit if the timeout has expired + * (dont wait forever for an itsy bitsy + * delay which will no be updated if + * select is called with no delay) + * + * current time is only updated by + * cac_select_io() if we specify + * at least 1 usec to wait */ remaining = timeout-delay; - if (remaining<=0.0) { + if (remaining<=(1.0/USEC_PER_SEC)) { /* * Make sure that we take care of * recv backlog at least once @@ -287,10 +294,6 @@ int epicsShareAPI ca_sg_block(CA_SYNC_GID gid, ca_real timeout) tmo.tv_usec = (long) ((remaining-tmo.tv_sec)*USEC_PER_SEC); cac_block_for_sg_completion (pcasg, &tmo); - /* - * the current time set within cac_block_for_sg_completion() - * above. - */ delay = cac_time_diff (&ca_static->currentTime, &beg_time); } pcasg->opPendCount = 0;