bool OS_IsInCriticalSection ()
Returns true if program is in critical section.
Everywhere
None
false |
program is not in critical section |
true |
program is in critical section |
void Task (void) { for (;;) { /*...*/ if (!OS_IsInCriticalSection()) { OS_Bsem_Wait(1); // wait for semaphore only when we are not in critical section }; /*...*/ } }