2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Get a shared lock on a semaphore.
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 /*****************************************************************************/
25 #include <proto/exec.h>
27 AROS_LH1(void, ObtainSemaphoreShared
,
30 AROS_LHA(struct SignalSemaphore
*, sigSem
, A0
),
33 struct ExecBase
*, SysBase
, 113, Exec
)
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
43 sigSem - Pointer to semaphore structure
48 This function preserves all registers.
59 *****************************************************************************/
65 struct TraceLocation tp
= CURRENT_LOCATION("ObtainSemaphoreShared");
67 InternalObtainSemaphore(sigSem
, NULL
, &tp
, SysBase
);
70 } /* ObtainSemaphoreShared */