mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yitzchak Eidus <ieidus@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: question about code from the linux kernel development ( se ) book
Date: Fri, 21 Oct 2005 13:22:51 +0200	[thread overview]
Message-ID: <e7aeb7c60510210422s33c0240ex4eab1d90d94111fe@mail.gmail.com> (raw)

first i am very sorry if it isnt the place to ask questions like this
but i didnt know where else to ask ( i tryed irc channels and i was
send from there to this list )
anyway:
does this following code look buggy? :
DECLARE_WAITQUEUE ( wait , current );
add_wait_queue ( q , &wait );
while ( !condition ) {
set_current_stat ( TASK_INTERRUPTABLE ); i
if ( signal_pending ( current ) )
/* handle signal */
schedule ( ); }
set_current_state ( TASK_RUNNING );
remove_wait_queue ( q , &wait );
first:doesnt in the way from checking the !condition to
set_current_state  the condition can be changed no?

second:why not putting the schedule ( ); right after the
set_current_state ( ) , what the point in checking the if (
signal_pending ( ) first, if the proccess doesnt started to sleep yet?
third: in the cleaning in the way from putting the set_current_state (
TASK_RUNNING ) into remove_wait_queue , cant the queue wait list ( q )
wake up again the wait procsess?
( thnks for the help , please if it can be done answer quickly i am
tanker in the idf and need to come back to the army soon , ( no
internet there... ) )
thnks!

             reply	other threads:[~2005-10-21 11:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 11:22 Yitzchak Eidus [this message]
2005-10-21 13:03 ` Steven Rostedt
2005-10-21 13:10   ` Jesper Juhl
2005-10-21 14:41   ` Yitzchak Eidus
2005-10-21 15:07     ` Steven Rostedt
2005-10-21 18:36   ` Lee Revell
2005-10-21 14:00 Nick Warne
2005-10-21 15:56 ` Steven Rostedt

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=e7aeb7c60510210422s33c0240ex4eab1d90d94111fe@mail.gmail.com \
    --to=ieidus@gmail.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

all inboxes | Powered by JetHome®