beautypg.com

Figure 3.30 task execution control by semaphore – Renesas 70 User Manual

Page 48

background image

Chapter 3 Introduction to MR308

- 38 -

Reference Semaphore Status (ref_sem, iref_sem)

Refers the status of the target semaphore. Checks the count value and existence of the wait task for
the target semaphore.

Figure 3.30 shows example task execution control provided by the wai_sem and sig_sem service
calls.

Task

Task

Task

Task

Semaphore

Counter

wai_sem

sig_sem

3

2

1

0

0

x

wai_sem

wai_sem

wai_sem

WAIT state

Figure 3.30 Task Execution Control by Semaphore