From 4e5ea6a61ccb7f41577cef51885fbc12d5f8cb6d Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 21 May 2007 17:51:50 +1000 Subject: [PATCH] use separate function for delayed start now that CommandTimeout has been changed to include retries and other stuff. r1972 | dcl | 2007-05-21 17:51:50 +1000 (Mon, 21 May 2007) | 2 lines --- asyncqueue.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/asyncqueue.c b/asyncqueue.c index 99df7b50..90e86dce 100644 --- a/asyncqueue.c +++ b/asyncqueue.c @@ -132,6 +132,7 @@ static int AQ_Reconnect(pAsyncQueue self) static int CommandTimeout(void* cntx, int mode); +static int DelayedStart(void* cntx, int mode); static int StartCommand(pAsyncQueue self) { @@ -167,7 +168,7 @@ static int StartCommand(pAsyncQueue self) delay *= 1000; delay += (when.tv_usec - now.tv_usec + (1000 - 1)) / 1000; NetWatchRegisterTimer(&self->nw_tmr, delay, - CommandTimeout, self); + DelayedStart, self); return OKOK; } } @@ -288,6 +289,14 @@ static int CommandTimeout(void* cntx, int mode) return 1; } +static int DelayedStart(void* cntx, int mode) +{ + pAsyncQueue self = (pAsyncQueue) cntx; + self->nw_tmr = 0; + StartCommand(self); + return 1; +} + static int MyCallback(void* context, int mode) { pAsyncQueue self = (pAsyncQueue) context;