I am trying to get a simple "timer thread" running under RTL-3.0.
The idea is to have the thread ("clock") set a global variable
("ALARM") non-zero when a certain period of time (1ms) expires.
If you have a few minutes, maybe you could look at my attached code
and 'dmesg' output. I can't understand why the loop (on "ctr") runs to
completion without detecting a non-zero ALARM value. Note that ALARM
*is* 1 when cleanup_module() is invoked.
What I am really after is a "timer thread" that I can enable
repeatedly as needed (not continuously) within my larger application.
I was hoping to later just user pthread_wakeup_np() to cause the
"clock" thread to again set ALARM after the 1ms (or whatever) period.
Of course I would need to reset ALARM to zero elsewhere in the code,
but I am now just trying to get it to work correctly even one time!
It is very likely that I am unclear on the semantics of various
pthread_ functions (*_kill, *_suspend_np, *_wakeup_np, ...).
Hopefully others can clear this fuzzy (at least for me) subject up a
bit.
Thanks for any help,
--
Prof Kenneth H Jacker [EMAIL PROTECTED]
Computer Science Dept www.cs.appstate.edu/~khj
Appalachian State Univ
Boone, NC 28608 USA
alarm.c
alarm-1.1.out