310
K
A
DAK
AMX 86 Procedures
ajsmwat ajsmwat
Purpose Wait on a Semaphore
Used by n Task o IS P o Timer Procedure o Restart Procedure n Exit Procedure
Setup AMXID semid;
long timeout;
unsigned int priority;
int status;
.
.
status = ajsmwat(semid, timeout, priority);
AX BX DX:CX DI
Where semid is the semaphore id of a counting semaphore acquired by a call to
ajsmcre.
timeout is the maximum interval measured in AMX system ticks which
the caller is prepared to wait for the semaphore. Timeout must be
positive. If timeout = 0, the caller will wait forever for the
semaphore.
priority is the priority at which the caller wishes to wait (0 = highest).
To wait in FIFO order, have all callers use the same value for
priority.
Results Interrupts are disabled and then enabled upon return.
Status is returned.
AEROK = Call successful
AERNSS = Invalid semaphore id
AERTMO = Timed out without being granted use of the semaphore
AERTMV = Invalid timeout interval (<0)
Restriction You must not attempt to wait on a resource semaphore. Use ajsmrsv for
that purpose.
See Also ajsmget, ajsmsig