Is it OK to use semph in vApplicationIdleHook

Is it ok to do this in  vApplicationIdleHook? xSemaphoreTake(xSemaphore, portMAX_DELAY);
++ulIdleCycleCount;
xSemaphoreGive(xSemaphore); I have another task which runs every second, prints the value of ulIdleCycleCount and then zeros it out.  Before I do this, it looks like about every 5 seconds, it does not get zero’d out, but still gets printed….
I know you cant delay in the idle task…..

Is it OK to use semph in vApplicationIdleHook

No, the idle task, including the Idle Hook, may not Block. If the Idle task was to block, then the scheduler would not be able to find anything to run, and tends to just crash. If you delay for 0, then it would be allowed, but then you would want to test for success before doing the give.

Is it OK to use semph in vApplicationIdleHook

thanks!