[quoted lines by Jaroslav Skarvada on 2016/05/11 at 12:42 -0400] >Hmm, for me the control flow reaches asyncAwaitCondition and then immediately >exits >due to the timeout. Maybe there is another/different problem.
You're correct. I didn't look closely enough. The timeout test shouldn't be done on the first iteration. Please test the attached patch (async-wait-1.patch). -- Dave Mielke | 2213 Fox Crescent | The Bible is the very Word of God. Phone: 1-613-726-0014 | Ottawa, Ontario | http://Mielke.cc/bible/ EMail: d...@mielke.cc | Canada K2A 1H7 | http://FamilyRadio.org/
diff --git a/Programs/async_wait.c b/Programs/async_wait.c index 231a07c..71b1372 100644 --- a/Programs/async_wait.c +++ b/Programs/async_wait.c @@ -142,13 +142,20 @@ awaitAction (long int timeout) { int asyncAwaitCondition (int timeout, AsyncConditionTester *testCondition, void *data) { + int first = 1; TimePeriod period; startTimePeriod(&period, timeout); while (!(testCondition && testCondition(data))) { long int elapsed; - if (afterTimePeriod(&period, &elapsed)) return 0; + if (first) { + first = 0; + elapsed = 0; + } else if (afterTimePeriod(&period, &elapsed)) { + return 0; + } + awaitAction(timeout - elapsed); }
_______________________________________________ This message was sent via the BRLTTY mailing list. To post a message, send an e-mail to: BRLTTY@mielke.cc For general information, go to: http://mielke.cc/mailman/listinfo/brltty