[En-Nut-Discussion] Event API

Harald Kipp harald.kipp at egnite.de
Wed Oct 27 10:53:24 CEST 2004


At 10:09 27.10.2004 +0200, you wrote:

>On 27-okt-04, at 9:40, Harald Kipp wrote:
>
>>At 19:58 26.10.2004 +0200, you wrote:
>>>Why is there no NutEventClear?
>>
>>
>>NutEventBroadcast() clears an event queue.
>
>But is also awakes waiting threads!

True, but I can hardly think of a situation where this
might be a problem.

As far as I understood the requirement:

- Thread A (or an interrupt) posts an event.

- Thread B initiates something and wants to wait for
the event exactly caused by _this_ initiation, not any
previously posted one.

The most difficult situation is probably when the
event is posted by an interrupt. Thread B:

   NutEnterCritical
   NutEventBroadcast
   Initiate something
   NutEventWait
   NutExitCritical

Don't get me wrong. I'm not against additional API calls.
I'm just unable to see the requirement here and can't think
of a situation where NutEventBroadcast would hurt.

IMHO, NutEventClear would be a misleading name. Let's
consider NutEventClearSignaled.

Harald





More information about the En-Nut-Discussion mailing list