#: 21271 S12/OS9/68000 (OSK)
17-Nov-95 15:40:26
Sb: OS-9 Ver 3.0 Bug
Fm: Paul N. Leonard 72477,774
To: all
////// OS-9 Version 3.0 BUG //////
The tsleep() function behaves differently in version 3.0 than
it prior to version 3.0, and the result is very intermittent
and can lock up your task. We had created a macro called
hard_tsleep() to insure that we slept for a specified period.
It worked fine before we started using OS-9 ver. 3.0.
In OS-9 version 3.0 tsleep(1) returns 1, not 0! This
causes the first macro below to loop endlessly. If you do any
sort of checking for tsleep returning 0, you may want to keep
this in mind.
/* original version, works under OS-9 prior to version 3.0 */ #define
hard_tsleep(T) { unsigned l; l=(T); while ((l=tsleep(l))!=0); }
/* new version, overcomes bug in OS-9 version 3.0 */ #define
hard_tsleep(T) { unsigned l; l=(T); while ((l=tsleep(l)) >1); }
/ Paul N. Leonard pnl@sgs.com / KE6PIJ Santa Clara ARES/RACES /
/_ Internet: pnl@sgs.com /_ ke6pij@sgs.com /_
/ CompuServe: 72477,774 / ke6pij@n0ary.#nocal.ca.usa.noam /
Press !>
|