AMX 86 Procedures
K
A
DAK
301
ajsmcre ajsmcre
Purpose Create a Semaphore
Used by n Task o IS P o Timer Procedure n Restart Procedure n Exit Procedure
Setup AMXID semid;
int value;
char tag[4];
int status;
.
.
status = ajsmcre(&semid, value, tag);
AX BX= BX [DX:CX]
Where &semid is a pointer to storage for the semaphore id of the semaphore
allocated to the caller.
value is the initial value of the semaphore.
(-1 <= value <= 32767)
If value is -1, then a resource semaphore is created with an initial
value of 1, making the resource free for use. Otherwise, a counting
semaphore is created with the initial count specified by parameter
value.
tag is a 4-character name tag for the semaphore.
Results Interrupts are disabled and then restored to their state at the time of the
call.
Status is returned.
AEROK = Call successful
AERISV = Invalid semaphore value
AERNSB = No free semaphore
If the call is unsuccessful, semid is undefined.
See Also ajsmdel, ajsmtag