[En-Nut-Discussion] Event API
Henk Kampman
henk at secondmove.com
Wed Oct 27 10:34:13 CEST 2004
On 27-okt-04, at 9:45, Matthias Ringwald wrote:
>
> On 26.10.2004, at 19:58, Henk Kampman wrote:
>
>> Why is there no NutEventClear?
>
> Because it's not (really) needed.
>
> NutEventClear is identical to the also non-existant NutEventInit
> which is realized by setting the event queue to 0:
> theEvent = 0
>
> hm. if your event might be posted from interrupt context, a critical
> section would come in handy.
>
> NutEventInit/Reset/Clear:
>
> NutEnterCritical()
> theEvent = 0
> NutExitCritical()
I think that the following is a safer approach.
void NutEventClear(volatile HANDLE * qh)
{
NutEnterCritical();
if (*qhp == SIGNALED)
*qhp = 0;
NutExitCritical();
}
Henk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 886 bytes
Desc: not available
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20041027/5c5d05e6/attachment-0001.bin>
More information about the En-Nut-Discussion
mailing list