gcc-4.6.2: Update with patch for gengtype.c
[AROS.git] / rom / graphics / closemonitor.c
blob7409c9132fd77f6d6e15aa88793efae01ddba449
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 #include "graphics_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/graphics.h>
18 AROS_LH1(LONG, CloseMonitor,
20 /* SYNOPSIS */
21 AROS_LHA(struct MonitorSpec *, monitor_spec, A0),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 120, Graphics)
26 /* FUNCTION
28 INPUTS
29 monitor_spec - pointer to a MonitorSpec opened via OpenMonitor(),
30 or NULL
32 RESULT
33 error - FALSE if MonitorSpec closed uneventfully
34 TRUE if MonitorSpec could not be closed
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 OpenMonitor(), graphics/monitor.h
45 INTERNALS
47 HISTORY
50 ******************************************************************************/
52 AROS_LIBFUNC_INIT
54 BOOL res = TRUE;
56 ObtainSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
58 if (monitor_spec->ms_OpenCount) {
59 monitor_spec->ms_OpenCount--;
60 res = FALSE;
63 ReleaseSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
65 return res;
67 AROS_LIBFUNC_EXIT
68 } /* CloseMonitor */