The programmer's perspective
Events can be signaled using __SIGNAL_EVENT. This adds an event to the queue for a particular thread that we want to signal, but does not actually commit that event to the queue yet. So the programmer needs to call __event_commit to actually commit the event to the queue. However, this still does not signal the thread that the event is for to wake. So the programmer needs to call __event_commit once more to actually signal the thread to wake up.
The problem
There are two major problems that prevent the use of events inside of task functions.
- The event system works such that ANY event can completely overwrite the committing procedure of the event currently being committed, since only a single non-volatile variable is used for the event and the thread we want to signal. So if there is an ISR that can be triggered at any time, using events inside tasks is effectively useless.
- Events used inside tasks are never committed. They cannot be committed inside the task, since it could lead to duplicate events in the case of a premature power failure (there is no actual way to prevent the programmer from doing this and causing potential inconsistencies). But the scheduler does not commit them either.
To conclude: events that are signaled inside tasks are either overwritten, never committed or can cause inconsistencies.