Task should be not blocked if flag which are we waiting for has been already set #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without changes:
To be more consistent in the way of handling Flags (whether Thread Flags or Event Flags is used)
osThreadFlagsWait
should not block a task when flag which we are waiting for has been already set. For instance, the same code but using Event FlagsWhen
osThreadFlagsWait
waits only for(1<<0)
flag but(1<<1)
flag is also set then inside FreeRTOSxTaskNotifyWait
function notification state is marked astaskNOT_WAITING_NOTIFICATION
.When next
osThreadFlagsWait
waits for(1<<1)
flag, task goes toBLOCKED
state even though(1<<1)
flag is actually set and task's notification value is 2(1<<1)
but task's notification state istaskNOT_WAITING_NOTIFICATION
.To resolve this issue task's notification state should be marked as
taskNOTIFICATION_RECEIVED
again after previousosThreadFlagsWait
.