I'm new to rtlinux (and indeed to linux in general) and have been trying to
come up to speed by, among other things, looking at the source code for rt
FIFO's. One part of rtf_read (below) leaves me with a question.
while (RTF_EMPTY(minor) ) {
if (signal_pending(current))
return -ERESTARTSYS;
fifo_setup_sleep(minor);
// point "X"
interruptible_sleep_on_timeout(&RTF_WAIT(minor),
RTL_FIFO_TIMEOUT);
}
Am I correct in assuming that, if an interrupt occurs, and data arrives,
while we are a point "X", will we sleep until the timeout occurs (even
though we have data)?
My instinct would have been to write something like the following:
for (;;) {
enter_critical();
if (!RTF_EMPTY(minor)) {
exit_critical ();
break;
}
fifo_setup_sleep (minor);
exit_critical_and_sleep (...); // an imaginary function
}
Is there some way of achieving this effect?
My apologies if this is all too dumb for words.
- John Bryant
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/