public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Liu, Hong" <hong.liu@intel.com>
To: george@mvista.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6] fix POSIX timers expire before their scheduled time
Date: Thu, 17 Mar 2005 10:20:22 +0800	[thread overview]
Message-ID: <1111026022.2994.54.camel@devlinux-hong> (raw)

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;



             reply	other threads:[~2005-03-17  2:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-17  2:20 Liu, Hong [this message]
2005-03-17  6:29 ` [PATCH 2.6] fix POSIX timers expire before their scheduled time George Anzinger
2005-03-17  6:48   ` Hong Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1111026022.2994.54.camel@devlinux-hong \
    --to=hong.liu@intel.com \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox