diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/include/eina_inline_lock_void.x | 247 |
1 files changed, 247 insertions, 0 deletions
diff --git a/libraries/eina/src/include/eina_inline_lock_void.x b/libraries/eina/src/include/eina_inline_lock_void.x new file mode 100644 index 0000000..8cb9a49 --- /dev/null +++ b/libraries/eina/src/include/eina_inline_lock_void.x | |||
@@ -0,0 +1,247 @@ | |||
1 | /* EINA - EFL data type library | ||
2 | * Copyright (C) 2011 Vincent Torri | ||
3 | * | ||
4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; | ||
16 | * if not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef EINA_INLINE_LOCK_VOID_X_ | ||
20 | #define EINA_INLINE_LOCK_VOID_X_ | ||
21 | |||
22 | #ifdef EINA_UNUSED | ||
23 | # undef EINA_UNUSED | ||
24 | #endif | ||
25 | #ifdef __GNUC__ | ||
26 | # define EINA_UNUSED __attribute__((unused)) | ||
27 | #else | ||
28 | # define EINA_UNUSED | ||
29 | #endif | ||
30 | |||
31 | /** | ||
32 | * @addtogroup Eina_Lock_Group Lock | ||
33 | * | ||
34 | * @brief These functions provide Mutual Exclusion objects management. | ||
35 | * | ||
36 | * @note On Windows XP, critical sections are used, while on Windows | ||
37 | * CE, standard Mutex objects are used. | ||
38 | * | ||
39 | * @{ | ||
40 | */ | ||
41 | |||
42 | /** | ||
43 | * @typedef Eina_Lock | ||
44 | * Abtract type for a mutual exclusive object. | ||
45 | */ | ||
46 | typedef void *Eina_Lock; | ||
47 | typedef void *Eina_RWLock; | ||
48 | typedef void *Eina_Condition; | ||
49 | typedef void *Eina_TLS; | ||
50 | |||
51 | /** | ||
52 | * @brief Create a new #Eina_Lock. | ||
53 | * | ||
54 | * @param mutex A pointer to the lock object. | ||
55 | * @return #EINA_TRUE on success, #EINA_FALSE otherwise. | ||
56 | * | ||
57 | * This function creates a new #Eina_Lock object and stores it in the | ||
58 | * @p mutex buffer. On success, this function returns #EINA_TRUE and | ||
59 | * #EINA_FALSE otherwise. To free the resources allocated by this | ||
60 | * function, use eina_lock_free(). For performance reasons, no check | ||
61 | * is done on @p mutex. | ||
62 | */ | ||
63 | static inline Eina_Bool | ||
64 | eina_lock_new(Eina_Lock *mutex EINA_UNUSED) | ||
65 | { | ||
66 | return EINA_FALSE; | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * @brief Free the ressources of the given lock object. | ||
71 | * | ||
72 | * @param mutex The lock object to free. | ||
73 | * | ||
74 | * This function frees the resources of @p mutex allocated by | ||
75 | * eina_lock_new(). For performance reasons, no check is done on | ||
76 | * @p mutex. | ||
77 | */ | ||
78 | static inline void | ||
79 | eina_lock_free(Eina_Lock *mutex EINA_UNUSED) | ||
80 | { | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * @brief Lock the given mutual exclusion object. | ||
85 | * | ||
86 | * @param mutex The lock object to lock. | ||
87 | * @return #EINA_TRUE on success, #EINA_FALSE otherwise. | ||
88 | * | ||
89 | * This function locks @p mutex. @p mutex must have been created by | ||
90 | * eina_lock_new(). On success, this function returns #EINA_TRUE and | ||
91 | * #EINA_FALSE otherwise. For performance reasons, no check is done on | ||
92 | * @p mutex. | ||
93 | */ | ||
94 | static inline Eina_Lock_Result | ||
95 | eina_lock_take(Eina_Lock *mutex EINA_UNUSED) | ||
96 | { | ||
97 | return EINA_LOCK_FAIL; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * @brief Try to lock the given mutual exclusion object. | ||
102 | * | ||
103 | * @param mutex The lock object to try to lock. | ||
104 | * @return #EINA_TRUE on success, #EINA_FALSE otherwise. | ||
105 | * | ||
106 | * This function tries to lock @p mutex. @p mutex must have been created by | ||
107 | * eina_lock_new(). If @p mutex can be locked, this function returns | ||
108 | * #EINA_TRUE; if @p mutex can not be locked, or is already locked, it | ||
109 | * returns #EINA_FALSE. This function does not block and returns | ||
110 | * immediately. For performance reasons, no check is done on | ||
111 | * @p mutex. | ||
112 | * | ||
113 | * @note On Windows CE, this function is actually eina_lock_take(). | ||
114 | */ | ||
115 | static inline Eina_Lock_Result | ||
116 | eina_lock_take_try(Eina_Lock *mutex EINA_UNUSED) | ||
117 | { | ||
118 | return EINA_LOCK_FAIL; | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * @brief Unlock the given mutual exclusion object. | ||
123 | * | ||
124 | * @param mutex The lock object to unlock. | ||
125 | * @return #EINA_TRUE on success, #EINA_FALSE otherwise. | ||
126 | * | ||
127 | * This function unlocks @p mutex. @p mutex must have been created by | ||
128 | * eina_lock_new(). On success, this function returns #EINA_TRUE and | ||
129 | * #EINA_FALSE otherwise. For performance reasons, no check is done on | ||
130 | * @p mutex. | ||
131 | */ | ||
132 | static inline Eina_Lock_Result | ||
133 | eina_lock_release(Eina_Lock *mutex EINA_UNUSED) | ||
134 | { | ||
135 | return EINA_LOCK_FAIL; | ||
136 | } | ||
137 | |||
138 | static inline void | ||
139 | eina_lock_debug(const Eina_Lock *mutex EINA_UNUSED) | ||
140 | { | ||
141 | } | ||
142 | |||
143 | static inline Eina_Bool | ||
144 | eina_condition_new(Eina_Condition *cond EINA_UNUSED, Eina_Lock *mutex EINA_UNUSED) | ||
145 | { | ||
146 | return EINA_FALSE; | ||
147 | } | ||
148 | |||
149 | static inline void | ||
150 | eina_condition_free(Eina_Condition *cond EINA_UNUSED) | ||
151 | { | ||
152 | } | ||
153 | |||
154 | static inline Eina_Bool | ||
155 | eina_condition_wait(Eina_Condition *cond EINA_UNUSED) | ||
156 | { | ||
157 | return EINA_FALSE; | ||
158 | } | ||
159 | |||
160 | static inline Eina_Bool | ||
161 | eina_condition_timedwait(Eina_Condition *cond EINA_UNUSED, double val EINA_UNUSED) | ||
162 | { | ||
163 | return EINA_FALSE; | ||
164 | } | ||
165 | |||
166 | static inline Eina_Bool | ||
167 | eina_condition_broadcast(Eina_Condition *cond EINA_UNUSED) | ||
168 | { | ||
169 | return EINA_FALSE; | ||
170 | } | ||
171 | |||
172 | static inline Eina_Bool | ||
173 | eina_condition_signal(Eina_Condition *cond EINA_UNUSED) | ||
174 | { | ||
175 | return EINA_FALSE; | ||
176 | } | ||
177 | |||
178 | static inline Eina_Bool | ||
179 | eina_rwlock_new(Eina_RWLock *mutex EINA_UNUSED) | ||
180 | { | ||
181 | return EINA_FALSE; | ||
182 | } | ||
183 | |||
184 | static inline void | ||
185 | eina_rwlock_free(Eina_RWLock *mutex EINA_UNUSED) | ||
186 | { | ||
187 | } | ||
188 | |||
189 | static inline Eina_Lock_Result | ||
190 | eina_rwlock_read_take(Eina_RWLock *mutex EINA_UNUSED) | ||
191 | { | ||
192 | return EINA_LOCK_FAIL; | ||
193 | } | ||
194 | |||
195 | static inline Eina_Lock_Result | ||
196 | eina_rwlock_write_take(Eina_RWLock *mutex EINA_UNUSED) | ||
197 | { | ||
198 | return EINA_LOCK_FAIL; | ||
199 | } | ||
200 | |||
201 | static inline Eina_Lock_Result | ||
202 | eina_rwlock_release(Eina_RWLock *mutex EINA_UNUSED) | ||
203 | { | ||
204 | return EINA_LOCK_FAIL; | ||
205 | } | ||
206 | |||
207 | static inline Eina_Lock_Result | ||
208 | eina_rwlock_take_read(Eina_RWLock *mutex EINA_UNUSED) | ||
209 | { | ||
210 | return EINA_LOCK_FAIL; | ||
211 | } | ||
212 | |||
213 | static inline Eina_Lock_Result | ||
214 | eina_rwlock_take_write(Eina_RWLock *mutex EINA_UNUSED) | ||
215 | { | ||
216 | return EINA_LOCK_FAIL; | ||
217 | } | ||
218 | |||
219 | static inline Eina_Bool | ||
220 | eina_tls_new(Eina_TLS *key EINA_UNUSED) | ||
221 | { | ||
222 | return EINA_FALSE; | ||
223 | } | ||
224 | |||
225 | static inline void | ||
226 | eina_tls_free(Eina_TLS key EINA_UNUSED) | ||
227 | { | ||
228 | } | ||
229 | |||
230 | static inline void * | ||
231 | eina_tls_get(Eina_TLS key EINA_UNUSED) | ||
232 | { | ||
233 | return NULL; | ||
234 | } | ||
235 | |||
236 | static inline Eina_Bool | ||
237 | eina_tls_set(Eina_TLS key EINA_UNUSED, const void *data EINA_UNUSED) | ||
238 | { | ||
239 | return EINA_FALSE; | ||
240 | } | ||
241 | |||
242 | |||
243 | /** | ||
244 | * @} | ||
245 | */ | ||
246 | |||
247 | #endif | ||