revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / realtime / lockrealtime.c
blob1685ba7f33c3c38dd50bc2bd88b08b8d7344335a
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include <proto/exec.h>
10 #include "realtime_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <libraries/realtime.h>
17 AROS_LH1(APTR, LockRealTime,
19 /* SYNOPSIS */
21 AROS_LHA(ULONG, lockType, D0),
23 /* LOCATION */
25 struct Library *, RealTimeBase, 5, RealTime)
27 /* FUNCTION
29 Lock a RealTime.library internal semaphore.
31 INPUTS
33 lockType -- The type of lock to aquire, see <libraries/realtime.h> for
34 further information.
36 RESULT
38 A handle to pass to UnlockRealTime() to unlock the semaphore. If 'lockType'
39 is invalid, NULL is returned.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 UnlockRealTime()
51 INTERNALS
53 HISTORY
55 26.7.99 SDuvan implemented
57 ******************************************************************************/
60 AROS_LIBFUNC_INIT
62 if(lockType >= RT_MAXLOCK)
63 return NULL;
65 ObtainSemaphore(&GPB(RealTimeBase)->rtb_Locks[lockType]);
67 return (APTR)(&GPB(RealTimeBase)->rtb_Locks[lockType]);
69 AROS_LIBFUNC_EXIT
70 } /* LockRealTime */