public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6] fix POSIX timers expire before their scheduled time
@ 2005-03-17  2:20 Liu, Hong
  2005-03-17  6:29 ` George Anzinger
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Hong @ 2005-03-17  2:20 UTC (permalink / raw)
  To: george; +Cc: linux-kernel

POSIX says: POSIX timers should not expire before their scheduled time.

Due to the timer started between jiffies, there are cases that the timer
will expire before its scheduled time.
This patch ensures timers will not expire early.

--- a/kernel/posix-timers.c     2005-03-10 15:46:27.329333664 +0800
+++ b/kernel/posix-timers.c     2005-03-10 15:50:11.884196136 +0800
@@ -957,7 +957,8 @@
                            &expire_64, &(timr->wall_to_prev))) {
                return -EINVAL;
        }
-       timr->it_timer.expires = (unsigned long)expire_64;
+       timr->it_timer.expires = (unsigned long)expire_64 + 1;
        tstojiffie(&new_setting->it_interval, clock->res, &expire_64);
        timr->it_incr = (unsigned long)expire_64;



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-17  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-17  2:20 [PATCH 2.6] fix POSIX timers expire before their scheduled time Liu, Hong
2005-03-17  6:29 ` George Anzinger
2005-03-17  6:48   ` Hong Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox