lkml.org 
[lkml]   [1999]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Problems writting a CHAR Driver with interruptible_sleep (wait_queu e)
Date
Benjamin LaHaise writes:
> current->state = TASK_INTERRUPTIBLE;
> add_wait_queue(&my_wait_queue, &wait);

That should be:
add_wait_queue(&my_wait_queue, &wait);
current->state = TASK_INTERRUPTIBLE;

otherwise there is a chance that the interrupt could occur between
the TASK_INTERRUPTIBLE and the add_wait_queue. If this does happen,
the task will not be on my_wait_queue, and therefore the state will
not be set to TASK_RUNNING.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |

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

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