Page 1 of 1

SB-7: Salvo: Incorrect Detection of Timed Out Status

PostPosted: Fri Jul 13, 2001 11:17 am
by Salvo Tech Support
Applies To

Salvo v2.2.1 and earlier.

Description of Problem

In instances where a task waits on multiple events with timeouts, the occurrence of the timeout may be incorrectly detected by OSTimedOut().

For example, in this code snippet:

OS_WaitBinSem(BINSEM1_P, timeout1, label1);
if ( OSTimedOut() ) {
/* A: handle timeout from binsem1 */

OS_WaitBinSem(BINSEM2_P, timeout2, label2);
if ( OSTimedOut() ) {
/* B: handle timeout from binsem2 */

a timeout will be (incorrectly) detected at point B if the first call to OS_WaitBinSem() times out AND binsem2 is available. In this case, OSTimedOut() will be TRUE at points A and B even though there was no timeout while waiting for binsem2.

Suggested Workaround

In the user source code for tasks that have multiple calls to OS_WaitXyz(), add the following line immediately before each call to OS_WaitXyz():

OScTcbP->u.runStatus = OScTcbP->status.bits;

Fixed In
Salvo v3.0.0.

[This message has been edited by Salvo Tech Support (edited January 13, 2002).]