Indentation fix, cleanup.
[AROS.git] / rom / exec / obtainsemaphoreshared.c
bloba4bb73e1ece0e92f82fa5556cc61283b105649c3
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Get a shared lock on a semaphore.
6 Lang: english
7 */
9 #include <exec/semaphores.h>
10 #include <aros/atomic.h>
12 #include "exec_intern.h"
13 #include "exec_util.h"
14 #include "semaphores.h"
16 #define CHECK_INITSEM 1
18 /*****************************************************************************/
19 #undef Exec
20 #ifdef UseExecstubs
21 # define Exec _Exec
22 #endif
24 /* NAME */
25 #include <proto/exec.h>
27 AROS_LH1(void, ObtainSemaphoreShared,
29 /* SYNOPSIS */
30 AROS_LHA(struct SignalSemaphore *, sigSem, A0),
32 /* LOCATION */
33 struct ExecBase *, SysBase, 113, Exec)
35 /* FUNCTION
36 Get a shared lock on a semaphore. If the lock cannot be obtained
37 immediately this function waits. There may be more than one shared
38 locks at the same time but only one exclusive one. An exclusive
39 lock prevents shared locks. Shared locks are released with
40 ReleaseSemaphore().
42 INPUTS
43 sigSem - Pointer to semaphore structure
45 RESULT
47 NOTES
48 This function preserves all registers.
50 EXAMPLE
52 BUGS
54 SEE ALSO
55 ReleaseSemaphore()
57 INTERNALS
59 *****************************************************************************/
61 #undef Exec
63 AROS_LIBFUNC_INIT
65 struct TraceLocation tp = CURRENT_LOCATION("ObtainSemaphoreShared");
67 InternalObtainSemaphore(sigSem, NULL, &tp, SysBase);
69 AROS_LIBFUNC_EXIT
70 } /* ObtainSemaphoreShared */