Expand description
Event groups: event_groups.c.
An event group is a word of bits and a list of the tasks waiting on some of them. It is the one FreeRTOS primitive with no queue underneath — a waiter’s condition lives in its own event list item, so setting a bit is one walk of that list asking each waiter whether it is satisfied.
§The item value is the condition
vTaskPlaceOnUnorderedEventList writes the bits a task is waiting for
into xEventListItem, where a priority-ordered event list would have
kept configMAX_PRIORITIES - uxPriority. The top byte carries three
flags with it — clear-on-exit, wait-for-all, and the one the unblocker
sets to say why the task woke — which is why the usable bits are the
bottom 24 and every comparison masks first.
A task that times out is taken off the event list by the tick, so its item value keeps the flags it blocked with and not the unblocked-due-to-bit-set one. That difference is the whole of the C’s timeout test, and it is why this module needs no timeout flag of its own.
Structs§
- Event
Group EventGroup_t: the bits, and nothing else — the list of waiting tasks is one of the kernel’s, named by the group’s arena index.
Constants§
- PENDED_
CLEAR_ BITS - The
functionaTickHook::pendedsees forxEventGroupClearBitsFromISR. - PENDED_
SET_ BITS - The
functionaTickHook::pendedsees forxEventGroupSetBitsFromISR.