xref: /aoo42x/main/sal/inc/osl/semaphor.h (revision 9eab2a37)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _OSL_SEMAPHORE_H_
25 #define _OSL_SEMAPHORE_H_
26 
27 #include <sal/types.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 typedef void* oslSemaphore;
34 
35 /** Creates a semaphore.<BR>
36 
37     @deprecated
38     Must not be used, as unnamed semaphores are not supported on Mac OS X.
39 
40 	@param InitialCount denotes the starting value the semaphore. If you set it to
41 	zero, the first acquire() blocks. Otherwise InitialCount acquire()s  are
42 	immedeatly  successfull.
43 	@return 0 if the semaphore could not be created, otherwise a handle to the sem.
44 */
45 oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount);
46 
47 /** Release the OS-structures and free semaphore data-structure
48 
49     @deprecated
50     Must not be used, as unnamed semaphores are not supported on Mac OS X.
51 
52 	@return fbbb
53 */
54 void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore);
55 
56 /** acquire() decreases the count. It will block if it tries to
57 	decrease below zero.
58 
59     @deprecated
60     Must not be used, as unnamed semaphores are not supported on Mac OS X.
61 
62 	@return False if the system-call failed.
63 */
64 sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore);
65 
66 /** tryToAcquire() tries to decreases the count. It will
67 	return with False if it would decrease the count below zero.
68 	(When acquire() would block.) If it could successfully
69 	decrease the count, it will return True.
70 
71     @deprecated
72     Must not be used, as unnamed semaphores are not supported on Mac OS X.
73 */
74 sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore);
75 
76 /** release() increases the count.
77 
78     @deprecated
79     Must not be used, as unnamed semaphores are not supported on Mac OS X.
80 
81 	@return False if the system-call failed.
82 */
83 sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif  /* _OSL_SEMAPHORE_H_  */
90 
91 
92