cre_sem
acre_sem
ER cre_sem (ID semid, T_CSEM *pk_csem );
ER_ID acre_sem ( T_CSEM *pk_csem );
typedef struct t_csem { ATR sematr; /*Semaphore attribute*/ UINT isemcnt; /*Initial semaphore count*/ UINT maxsem; /*Maximum semaphore count*/ } T_CSEM; |
The cre_sem creates a semaphore with semaphore ID indicated by semid according to the content of pk_csem. The acre_sem creates a semaphore according to the content of pk_csem, and returns the created semaphore ID.
sematr := ( TA_TFIFO | TA_TPRI )
- TA_TPRI ( = 0x0001)
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
2 ) Initial semaphore count (isemcnt)
Specify initial semaphore count within the range from 0 to maxsem.
Specify initial semaphore count within the range from 0 to maxsem.
3 ) Maximum semaphore count (maxsem)
Specify maximum semaphore count within the range from 1 to TMAX_MAXSEM ( = 65535).
Specify maximum semaphore count within the range from 1 to TMAX_MAXSEM ( = 65535).