Querying Task Notification pending?

Is it possible for a “sending” task, i.e., the one that sent the notification using xTaskNotify(), to determine if the notification is still pending, e.g., similar to uxSemaphoreGetCount() on a binary semaphore?

I looked at xTaskNotifyAndQuery(), but that seemed intended for retrieving the notification value, not the notification state.

Can you use xTaskNotifyAndQuery() with the action set to no action?

1 Like

No specific application, although I did previously do something similar with a counting semaphore to create “backpressure”. So, if the sending task has the option of either holding off on another notification or perhaps sending it to a different task, it might like to check the status of the first notification.

Not as I understand it. The return value will always be pdPASS and you can only pass out the notification value, not the state. Furthermore, I wasn’t sure how to interpret this:

eNoAction The target task receives the event, but its notification value is not updated. In this case ulValue is not used.

Does the statement that the target task “receives” the event mean that the state is change to “pending” if it is previously “non-pending”? That is unclear from the description.