Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / realtime / realtime_init.c
blob40c0bd50af4b6bb1c5c5c92e58b92345924fb2a6
1 /*
2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Realtime.library initialization code.
6 Lang: English.
7 */
9 /* HISTORY: 25.06.99 SDuvan Began implementing... */
11 #ifndef DEBUG
12 #define DEBUG 0
13 #endif
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))
45 return FALSE;
48 D(bug("[realtime.library] initialized\n");)
50 return TRUE;
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);
63 return TRUE;
67 ADD2INITLIB(Init, 0);
68 ADD2EXPUNGELIB(Expunge, 0);