2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
5 Desc: Realtime.library initialization code.
9 /* HISTORY: 25.06.99 SDuvan Began implementing... */
14 #include <aros/debug.h>
16 #include <exec/types.h>
17 #include <exec/resident.h>
18 #include <proto/exec.h>
19 #include <aros/symbolsets.h>
21 #include <exec/libraries.h>
23 #include "realtime_intern.h"
24 #include LC_LIBDEFS_FILE
27 BOOL
AllocTimer(struct internal_RealTimeBase
*RealTimeBase
);
28 void FreeTimer(struct internal_RealTimeBase
*RealTimeBase
);
30 static int Init(LIBBASETYPEPTR LIBBASE
)
32 /* This function is single-threaded by exec by calling Forbid. */
34 WORD i
; /* Loop variable */
36 for(i
= 0; i
< RT_MAXLOCK
; i
++)
38 InitSemaphore(&RealTimeBase
->rtb_Locks
[i
]);
41 NEWLIST(&RealTimeBase
->rtb_ConductorList
);
43 if (!AllocTimer((struct internal_RealTimeBase
*)RealTimeBase
))
48 D(bug("[realtime.library] initialized\n");)
54 static int Expunge(LIBBASETYPEPTR LIBBASE
)
57 This function is single-threaded by exec by calling Forbid.
58 Never break the Forbid() or strange things might happen.
61 FreeTimer(RealTimeBase
);
68 ADD2EXPUNGELIB(Expunge
, 0);