I am not sure how to clear event bits if several tasks are waiting for the same bits.
Let us concider three tasks waiting for the same bit. Let their names be TASK_1, TASK_2 and TASK_3.
Suppose that TASK_1 and TASK_2 have priority of 1 and TASK_3 has priority of 2.
Imagine that bit of interest is set by task 4. Here comes my questions:
- At first TASK_3 will wake up since it has the highest priority. If bit is cleared inside TASK_3 will TASK_1 and TASK_2 still be executed?
- What if instead of clearing bit inside TASK_3 it is done in one of lower priority tasks i.e. TASK_1 and TASK_2. Does it ensure that all the tasks will wake up?
- What if TASK_3 sets bit of interest and clear it right after setting. Will TASK_1 and TASK_2 be unblocked in this case?