
B–61863E–1/06
2. PMC SYSTEM CALLPMC LIBRARY
159
SC/SC3/SC4 NB/NB2 16i/18i/21i 15i–A
f f f f
[Name]
os_sign_sem
[Description]
Signals the semaphore.
[Format]
ret = os_sign_sem(semaphore_id) ;
unsigned short ret ;
unsigned char semaphore_id ;
[Input]
semaphore_id Semaphore ID (10 to 39)
[Output]
______
[Returns]
ret Completion code
0 ; The semaphore has been signaled normally.
0106H ; The semaphore ID is out of range (other than 10 to 39).
0110H ; There is no specified semaphore ID.
011CH ; The semaphore counter value overflowed (127 or more).
0140H ; Other semaphores were accessed.
016EH ; The task that signals the semaphore has no semaphore
ownership.
[Remarks]
(For the counter type semaphore)
The counter is incremented. If it is 0 or less, one task is selected from
the waiting tasks according to the queue type and is made to be ready.
(For the exclusive control semaphore)
An error occurs if the task to be signaled has no semaphore
ownership. The ownership counter is decremented. If it becomes 0,
the ownership is returned. The task priority is also returned to the
original value. If waiting tasks exist, one task is selected from them
according to the queue type. The selected task is assigned the
ownership and is made to be ready. If the priority of the task is less
than the value set in the semaphore, the task priority is increased.
2.17
SIGNALING THE
SEMAPHORE