summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-12-05 14:01:42 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-12-05 14:01:42 +0000
commit8c2e7f7b87195bad534568f6e740e2d9b7707f89 (patch)
tree74c3272262786220cb5209f9eb3969ab48817c6e
parent792e7bffedc93585bb4b58bb2ed064f5899673ab (diff)
evas: use eina_lock a little bit more.
SVN revision: 65904
-rw-r--r--legacy/evas/src/lib/include/evas_common.h36
1 files changed, 10 insertions, 26 deletions
diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h
index f81720249c..90d349c1d7 100644
--- a/legacy/evas/src/lib/include/evas_common.h
+++ b/legacy/evas/src/lib/include/evas_common.h
@@ -138,8 +138,6 @@ extern EAPI int _evas_log_dom_global;
138# define BUILD_PTHREAD 138# define BUILD_PTHREAD
139#endif 139#endif
140 140
141#ifdef BUILD_PTHREAD
142
143#define LK(x) Eina_Lock x 141#define LK(x) Eina_Lock x
144#define LKI(x) eina_lock_new(&(x)) 142#define LKI(x) eina_lock_new(&(x))
145#define LKD(x) eina_lock_free(&(x)) 143#define LKD(x) eina_lock_free(&(x))
@@ -148,42 +146,28 @@ extern EAPI int _evas_log_dom_global;
148#define LKU(x) eina_lock_release(&(x)) 146#define LKU(x) eina_lock_release(&(x))
149#define LKDBG(x) eina_lock_debug(&(x)) 147#define LKDBG(x) eina_lock_debug(&(x))
150 148
149/* for rwlocks */
150#define RWLK(x) Eina_RWLock x
151#define RWLKI(x) eina_rwlock_new(&(x))
152#define RWLKD(x) eina_rwlock_free(&(x))
153#define RDLKL(x) eina_rwlock_take_read(&(x))
154#define WRLKL(x) eina_rwlock_take_write(&(x))
155#define RWLKU(x) eina_rwlock_release(&(x))
156
157#ifdef BUILD_PTHREAD
158
151# define TH(x) pthread_t x 159# define TH(x) pthread_t x
152# define THI(x) int x 160# define THI(x) int x
153# define TH_MAX 8 161# define TH_MAX 8
154 162
155/* for rwlocks */
156#define RWLK(x) pthread_rwlock_t x
157#define RWLKI(x) pthread_rwlock_init(&(x), NULL)
158#define RWLKD(x) pthread_rwlock_destroy(&(x))
159#define RDLKL(x) pthread_rwlock_rdlock(&(x))
160#define WRLKL(x) pthread_rwlock_wrlock(&(x))
161#define RWLKU(x) pthread_rwlock_unlock(&(x))
162
163
164// even though in theory having every Nth rendered line done by a different 163// even though in theory having every Nth rendered line done by a different
165// thread might even out load across threads - it actually slows things down. 164// thread might even out load across threads - it actually slows things down.
166//#define EVAS_SLI 1 165//#define EVAS_SLI 1
167 166
168#else 167#else
169# define LK(x)
170# define LKI(x)
171# define LKD(x)
172# define LKL(x)
173# define LKT(x) 1
174# define LKU(x)
175# define TH(x) 168# define TH(x)
176# define THI(x) 169# define THI(x)
177# define TH_MAX 0 170# define TH_MAX 0
178# define LKDBG(x)
179
180/* for rwlocks */
181#define RWLK(x)
182#define RWLKI(x)
183#define RWLKD(x)
184#define RDLKL(x)
185#define WRLKL(x)
186#define RWLKU(x)
187 171
188#endif 172#endif
189 173