Page 1 of 1

SB-14: Salvo: Event Flags and Timeouts

PostPosted: Wed Oct 09, 2002 3:29 am
by Salvo Tech Support
Applies To

All Salvo v3 releases, including Salvo v3.0.9 and earlier.

Description of Problem

When multiple tasks wait an event flag, any task(s) waiting with a timeout on the event flag will fail to timeout if the event flag is signaled within the timeout period, regardless of how the event flag is signaled (i.e. for any combination of parameters of OSSetEFlag()).

In other words, every time an eFlag is signaled, the timeout period of the task(s) that is(are) waiting the eFlag is(are) reset.

A typical scenario is:

I have two tasks, A and B, and an event flag E.

Task A waits on event flag E with mask 0xF0 and no timeout.

Task B waits on event flag E with mask 0x0F and a timeout.

Some combination of circumstances causes task B's timeout to never happen, although it continues to receive event flags. Timeouts are still working elsewhere in the code, as are OS_Delay calls.

Suggested Workaround

Use separate eFlags for each task that must wait an eFlag. This will solve the timeout problem, but only if the eFlag is set (signaled) with exactly the mask and options with which the task is waiting the eFlag.

Fixed In

TBD. It is likely that the eFlag functionality will be enhanced, and with it, this problem will be resolved.

[This message has been edited by aek (edited February 23, 2006).]