Hi folks,

I have the following problem:

I have a "main thread" that has to read data from the serial port only if
any data is available. On the other hand, the thread must not wait longer
than let's say one second.

The one thing ( reading only if data is available ) I implemented using a
mutex variable between the main thread and the isr from the corresponding
COM-Port. That works fine.

The timer, I implemented as follows:
When the thread starts, it makes himself periodic. For the period I
intentionally used one second. After the thread is periodic, I suspend the
thread until the next period. After the thread is waked up by the
scheduler, I know, that one second has past and I unlock my main thread,
if it is still blocked.
The problem is, that the system hangs, when I load my module into the
kernel.

Has anybody an idea howto implement a timer ( or whether there are
predefined functions ) that can be used in conjunction with mutex
variables ?

Thanks everybody in advance ....
  Ralf Ramrath


-- [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/

Reply via email to