aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_inline_lock_void.x
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/include/eina_inline_lock_void.x')
-rw-r--r--libraries/eina/src/include/eina_inline_lock_void.x273
1 files changed, 0 insertions, 273 deletions
diff --git a/libraries/eina/src/include/eina_inline_lock_void.x b/libraries/eina/src/include/eina_inline_lock_void.x
deleted file mode 100644
index 2f5209f..0000000
--- a/libraries/eina/src/include/eina_inline_lock_void.x
+++ /dev/null
@@ -1,273 +0,0 @@
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 */
46typedef void *Eina_Lock;
47typedef void *Eina_RWLock;
48typedef void *Eina_Condition;
49typedef void *Eina_TLS;
50typedef void *Eina_Semaphore;
51
52/**
53 * @brief Create a new #Eina_Lock.
54 *
55 * @param mutex A pointer to the lock object.
56 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
57 *
58 * This function creates a new #Eina_Lock object and stores it in the
59 * @p mutex buffer. On success, this function returns #EINA_TRUE and
60 * #EINA_FALSE otherwise. To free the resources allocated by this
61 * function, use eina_lock_free(). For performance reasons, no check
62 * is done on @p mutex.
63 */
64static inline Eina_Bool
65eina_lock_new(Eina_Lock *mutex EINA_UNUSED)
66{
67 return EINA_TRUE;
68}
69
70/**
71 * @brief Free the ressources of the given lock object.
72 *
73 * @param mutex The lock object to free.
74 *
75 * This function frees the resources of @p mutex allocated by
76 * eina_lock_new(). For performance reasons, no check is done on
77 * @p mutex.
78 */
79static inline void
80eina_lock_free(Eina_Lock *mutex EINA_UNUSED)
81{
82}
83
84/**
85 * @brief Lock the given mutual exclusion object.
86 *
87 * @param mutex The lock object to lock.
88 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
89 *
90 * This function locks @p mutex. @p mutex must have been created by
91 * eina_lock_new(). On success, this function returns #EINA_TRUE and
92 * #EINA_FALSE otherwise. For performance reasons, no check is done on
93 * @p mutex.
94 */
95static inline Eina_Lock_Result
96eina_lock_take(Eina_Lock *mutex EINA_UNUSED)
97{
98 return EINA_LOCK_SUCCEED;
99}
100
101/**
102 * @brief Try to lock the given mutual exclusion object.
103 *
104 * @param mutex The lock object to try to lock.
105 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
106 *
107 * This function tries to lock @p mutex. @p mutex must have been created by
108 * eina_lock_new(). If @p mutex can be locked, this function returns
109 * #EINA_TRUE; if @p mutex can not be locked, or is already locked, it
110 * returns #EINA_FALSE. This function does not block and returns
111 * immediately. For performance reasons, no check is done on
112 * @p mutex.
113 *
114 * @note On Windows CE, this function is actually eina_lock_take().
115 */
116static inline Eina_Lock_Result
117eina_lock_take_try(Eina_Lock *mutex EINA_UNUSED)
118{
119 return EINA_LOCK_SUCCEED;
120}
121
122/**
123 * @brief Unlock the given mutual exclusion object.
124 *
125 * @param mutex The lock object to unlock.
126 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
127 *
128 * This function unlocks @p mutex. @p mutex must have been created by
129 * eina_lock_new(). On success, this function returns #EINA_TRUE and
130 * #EINA_FALSE otherwise. For performance reasons, no check is done on
131 * @p mutex.
132 */
133static inline Eina_Lock_Result
134eina_lock_release(Eina_Lock *mutex EINA_UNUSED)
135{
136 return EINA_LOCK_SUCCEED;
137}
138
139static inline void
140eina_lock_debug(const Eina_Lock *mutex EINA_UNUSED)
141{
142}
143
144static inline Eina_Bool
145eina_condition_new(Eina_Condition *cond EINA_UNUSED, Eina_Lock *mutex EINA_UNUSED)
146{
147 return EINA_TRUE;
148}
149
150static inline void
151eina_condition_free(Eina_Condition *cond EINA_UNUSED)
152{
153}
154
155static inline Eina_Bool
156eina_condition_wait(Eina_Condition *cond EINA_UNUSED)
157{
158 return EINA_TRUE;
159}
160
161static inline Eina_Bool
162eina_condition_timedwait(Eina_Condition *cond EINA_UNUSED, double val EINA_UNUSED)
163{
164 return EINA_TRUE;
165}
166
167static inline Eina_Bool
168eina_condition_broadcast(Eina_Condition *cond EINA_UNUSED)
169{
170 return EINA_TRUE;
171}
172
173static inline Eina_Bool
174eina_condition_signal(Eina_Condition *cond EINA_UNUSED)
175{
176 return EINA_TRUE;
177}
178
179static inline Eina_Bool
180eina_rwlock_new(Eina_RWLock *mutex EINA_UNUSED)
181{
182 return EINA_TRUE;
183}
184
185static inline void
186eina_rwlock_free(Eina_RWLock *mutex EINA_UNUSED)
187{
188}
189
190static inline Eina_Lock_Result
191eina_rwlock_read_take(Eina_RWLock *mutex EINA_UNUSED)
192{
193 return EINA_LOCK_SUCCEED;
194}
195
196static inline Eina_Lock_Result
197eina_rwlock_write_take(Eina_RWLock *mutex EINA_UNUSED)
198{
199 return EINA_LOCK_SUCCEED;
200}
201
202static inline Eina_Lock_Result
203eina_rwlock_release(Eina_RWLock *mutex EINA_UNUSED)
204{
205 return EINA_LOCK_SUCCEED;
206}
207
208static inline Eina_Lock_Result
209eina_rwlock_take_read(Eina_RWLock *mutex EINA_UNUSED)
210{
211 return EINA_LOCK_SUCCEED;
212}
213
214static inline Eina_Lock_Result
215eina_rwlock_take_write(Eina_RWLock *mutex EINA_UNUSED)
216{
217 return EINA_LOCK_SUCCEED;
218}
219
220static inline Eina_Bool
221eina_tls_new(Eina_TLS *key EINA_UNUSED)
222{
223 return EINA_TRUE;
224}
225
226static inline void
227eina_tls_free(Eina_TLS key EINA_UNUSED)
228{
229}
230
231static inline void *
232eina_tls_get(Eina_TLS key EINA_UNUSED)
233{
234 return NULL;
235}
236
237static inline Eina_Bool
238eina_tls_set(Eina_TLS key EINA_UNUSED, const void *data EINA_UNUSED)
239{
240 return EINA_TRUE;
241}
242
243static inline Eina_Bool
244eina_semaphore_new(Eina_Semaphore *sem EINA_UNUSED,
245 int count_init EINA_UNUSED)
246{
247 return EINA_TRUE;
248}
249
250static inline Eina_Bool
251eina_semaphore_free(Eina_Semaphore *sem EINA_UNUSED)
252{
253 return EINA_TRUE;
254}
255
256static inline Eina_Bool
257eina_semaphore_lock(Eina_Semaphore *sem EINA_UNUSED)
258{
259 return EINA_TRUE;
260}
261
262static inline Eina_Bool
263eina_semaphore_release(Eina_Semaphore *sem EINA_UNUSED,
264 int count_release EINA_UNUSED)
265{
266 return EINA_TRUE;
267}
268
269/**
270 * @}
271 */
272
273#endif