[lkml]   [2000]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Interrupt/Sleep deadlock
In message <> 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).


From Documentation/DocBook/kernel-hacking.tmpl:

Wait Queues

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,
Hacking time.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:08    [W:0.097 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site