2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Lock 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 /*****************************************************************************/
23 #include <proto/exec.h>
25 AROS_LH1(void, ObtainSemaphore
,
28 AROS_LHA(struct SignalSemaphore
*, sigSem
, A0
),
31 struct ExecBase
*, SysBase
, 94, Exec
)
34 Obtain an exclusive lock on a semaphore. If the semaphore is already
35 in use by another task this function will wait until the semaphore
39 sigSem - Pointer to semaphore structure
44 This function preserves all registers.
55 *****************************************************************************/
61 struct TraceLocation tp
= CURRENT_LOCATION("ObtainSemaphore");
62 struct Task
*me
= FindTask(NULL
);
64 InternalObtainSemaphore(sigSem
, me
, &tp
, SysBase
);
67 } /* ObtainSemaphore */