xref: /aoo42x/main/sal/inc/osl/semaphor.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _OSL_SEMAPHORE_H_
29 #define _OSL_SEMAPHORE_H_
30 
31 #include <sal/types.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef void* oslSemaphore;
38 
39 /** Creates a semaphore.<BR>
40 
41     @deprecated
42     Must not be used, as unnamed semaphores are not supported on Mac OS X.
43 
44 	@param InitialCount denotes the starting value the semaphore. If you set it to
45 	zero, the first acquire() blocks. Otherwise InitialCount acquire()s  are
46 	immedeatly  successfull.
47 	@return 0 if the semaphore could not be created, otherwise a handle to the sem.
48 */
49 oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount);
50 
51 /** Release the OS-structures and free semaphore data-structure
52 
53     @deprecated
54     Must not be used, as unnamed semaphores are not supported on Mac OS X.
55 
56 	@return fbbb
57 */
58 void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore);
59 
60 /** acquire() decreases the count. It will block if it tries to
61 	decrease below zero.
62 
63     @deprecated
64     Must not be used, as unnamed semaphores are not supported on Mac OS X.
65 
66 	@return False if the system-call failed.
67 */
68 sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore);
69 
70 /** tryToAcquire() tries to decreases the count. It will
71 	return with False if it would decrease the count below zero.
72 	(When acquire() would block.) If it could successfully
73 	decrease the count, it will return True.
74 
75     @deprecated
76     Must not be used, as unnamed semaphores are not supported on Mac OS X.
77 */
78 sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore);
79 
80 /** release() increases the count.
81 
82     @deprecated
83     Must not be used, as unnamed semaphores are not supported on Mac OS X.
84 
85 	@return False if the system-call failed.
86 */
87 sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif  /* _OSL_SEMAPHORE_H_  */
94 
95 
96