tools/genmodule: Fix error in tests/clib/execl; should also fix gcc
[AROS.git] / rom / graphics / closemonitor.c
blob683f82f38442f608fd0a2735b3a639f7d5c5b223
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function CloseMonitor()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <graphics/monitor.h>
11 /*****************************************************************************
13 NAME */
14 #include <proto/graphics.h>
16 AROS_LH1(LONG, CloseMonitor,
18 /* SYNOPSIS */
19 AROS_LHA(struct MonitorSpec *, monitor_spec, A0),
21 /* LOCATION */
22 struct GfxBase *, GfxBase, 120, Graphics)
24 /* FUNCTION
26 INPUTS
27 monitor_spec - pointer to a MonitorSpec opened via OpenMonitor(),
28 or NULL
30 RESULT
31 error - FALSE if MonitorSpec closed uneventfully
32 TRUE if MonitorSpec could not be closed
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 OpenMonitor(), graphics/monitor.h
43 INTERNALS
45 HISTORY
48 ******************************************************************************/
50 AROS_LIBFUNC_INIT
52 BOOL res = TRUE;
54 ObtainSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
56 if (monitor_spec->ms_OpenCount) {
57 monitor_spec->ms_OpenCount--;
58 res = FALSE;
61 ReleaseSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
63 return res;
65 AROS_LIBFUNC_EXIT
66 } /* CloseMonitor */