diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-10-16 11:07:05 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-10-17 13:54:53 +1000 |
commit | bc58a12ffba8224af7280c3c8587edd5cd0a994e (patch) | |
tree | 94d3ce09984b800afbdcc227e63028e0340a6d8d | |
parent | 688f8fe770b2df178b5cc4e8a5bea0770d2a8803 (diff) |
sync: schedule a wakeup if we're called on the positive transition
Complement to a2e67a6412386782cb8b644b86a5744591397d45 which handled this for
the negative transition case. If we have an alarm on a positive transition on
the idletimer and get called exactly on the trigger, schedule a wakeup for a
ms.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | Xext/sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xext/sync.c b/Xext/sync.c index ff670b164..aa31808ff 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2688,12 +2688,12 @@ IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMa */ unsigned long timeout = -1; - if (XSyncValueLessThan(idle, *greater)) { + if (XSyncValueLessOrEqual(idle, *greater)) { XSyncValue value; Bool overflow; XSyncValueSubtract(&value, *greater, idle, &overflow); - timeout = min(timeout, XSyncValueLow32(value)); + timeout = max(1, min(timeout, XSyncValueLow32(value))); } else { for (list = counter->sync.pTriglist; list; |