Shown here is how a semaphore can be used to block a task. In the simplest case, one has a task that is running and in that task’s function, it makes the API call Semaphore_pend() on the mySem semaphore. Because mySem has a count of 0, the call to Semaphore_pend() will cause the scheduler to move this task to the BLOCKED state and at this point, some other thread will start to execute.