Re: Interrupt/Sleep deadlock

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Fri Sep 29 2000 - 02:29:24 EST


In message <20000928183243.D7797@one-eyed-alien.net> you write:
> Heh.. I needed to figure this out about 6 months ago. Here's the "right
> answer"
>
> Before sending the command to the board, call
> set_current_state(TASK_UNINTERRUPTIBLE).

*Ahem*

>From Documentation/DocBook/kernel-hacking.tmpl:

  Wait Queues
  ...
    Queuing

    Placing yourself in the waitqueue is fairly complex, because you
    must put yourself in the queue before checking the condition.
    There is a macro to do this: wait_event_interruptible()
    include/linux/sched.h. The first argument is the wait queue head,
    and the second is an expression which is evaluated; the macro
    returns 0 when this expression is true, or -ERESTARTSYS if a
    signal is received.

    The wait_event() version ignores signals.

Hope that helps,
Rusty.

--
Hacking time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:07 EST