|
|||||||||||
|
tsleep question
From: Alexandre Ratchov <aratchov(at)magphy.ujf-grenoble.fr>
Date: Mon May 12 2003 - 09:11:23 EDT
i'm working on a midi device driver and i have the following question about the 'read' system call:
s = splaudio();
tsleep(&bla, PWAIT|PCATCH, "rd", 0);
the caller needs to sleep until data becomes available, when data arrives, the interrupt handler calls wakeup(). If i do not disable interrupts, an interrupt can occur between the "while" and the "tsleep", which will "hang" the process. When tsleep switches to another process context, does it restore the system priority level? Is this the right way to wait for data? thanks, and sorry for my poor english. -- AlexReceived on Mon May 12 09:18:30 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:48:39 EDT |
||||||||||
|
|||||||||||