revert between 56095 -> 55830 in arch
[AROS.git] / rom / exec / attemptsemaphore.c
blob4ddbfafb03c831485fb7080eec2d3b2a4e7bd1c5
1 /*
2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Try to lock a sempahore.
6 Lang: english
7 */
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 /*****************************************************************************
18 NAME */
20 AROS_LH1(ULONG, AttemptSemaphore,
22 /* SYNOPSIS */
23 AROS_LHA(struct SignalSemaphore *, sigSem, A0),
25 /* LOCATION */
26 struct ExecBase *, SysBase, 96, Exec)
28 /* FUNCTION
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.
33 INPUTS
34 sigSem - Pointer to semaphore structure.
36 RESULT
37 TRUE if the semaphore could be obtained, FALSE otherwise.
39 NOTES
40 The lock must be freed with ReleaseSemaphore().
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 ReleaseSemaphore()
49 INTERNALS
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct TraceLocation tp = CURRENT_LOCATION("AttemptSemaphore");
56 struct Task *ThisTask = GET_THIS_TASK;
58 return InternalAttemptSemaphore(sigSem, ThisTask, &tp, SysBase);
60 AROS_LIBFUNC_EXIT
61 } /* AttemptSemaphore */