2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
5 Desc: Try to lock a sempahore.
9 #include <exec/semaphores.h>
10 #include <proto/exec.h>
12 #include "exec_intern.h"
13 #include "exec_util.h"
14 #include "semaphores.h"
16 /*****************************************************************************
20 AROS_LH1(ULONG
, AttemptSemaphore
,
23 AROS_LHA(struct SignalSemaphore
*, sigSem
, A0
),
26 struct ExecBase
*, SysBase
, 96, Exec
)
29 Tries to get an exclusive lock on a signal semaphore. If the semaphore
30 is already in use by another task, this function does not wait but
31 returns false instead.
34 sigSem - Pointer to semaphore structure.
37 TRUE if the semaphore could be obtained, FALSE otherwise.
40 The lock must be freed with ReleaseSemaphore().
51 *****************************************************************************/
55 struct TraceLocation tp
= CURRENT_LOCATION("AttemptSemaphore");
56 struct Task
*ThisTask
= GET_THIS_TASK
;
58 return InternalAttemptSemaphore(sigSem
, ThisTask
, &tp
, SysBase
);
61 } /* AttemptSemaphore */