mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 杨波 <struggle@mail.nankai.edu.cn>
To: linux-kernel@vger.kernel.org
Subject: sleep for ever ?
Date: Wed, 06 Sep 2006 22:07:59 +0800	[thread overview]
Message-ID: <357551904.04167@mail.nankai.edu.cn> (raw)
Message-ID: <44FED63F.2090204@mail.nankai.edu.cn> (raw)

Hi ,
    Take a look at following code :

DECLARE_WAITQUEUE(wait, current);

add_wait_queue(q, &wait);
while (!condition) {
        /* if there is an interrupt here , and the interrupt
           is just the one the sleeping process wait
           for , is this process sleep for the interrupt
           for ever ?*/
        set_current_state(TASK_INTERRUPTIBLE);
        if (signal_pending(current))
                /* handle signal */
        schedule();
}
set_current_state(TASK_RUNNING);
remove_wait_queue(q, &wait);

Suppose the process just want to sleep for an hardware
event , but before the set_current_state() call , the event
come , is the process sleep for ever ?


             reply	other threads:[~2006-09-06 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <44FED63F.2090204@mail.nankai.edu.cn>
2006-09-06 14:07 ` 杨波 [this message]
     [not found] <44FED695.9030501@mail.nankai.edu.cn>
2006-09-06 14:09 ` 杨波
     [not found] <44FED70F.6080208@mail.nankai.edu.cn>
2006-09-06 14:11 ` Bo Yang
2006-09-07 10:01   ` Tejun Heo

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=357551904.04167@mail.nankai.edu.cn \
    --to=struggle@mail.nankai.edu.cn \
    --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

Powered by JetHome