summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-28 02:55:13 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-28 02:58:54 +0900
commit4b894e01b5bf2218e39a0727f12edc1f61f9e9b0 (patch)
treec93ec976a17cd827980ccf8946201e4ca59b86b0 /src
parent08e4f0ce8d5c08f8e73ce83532bcba275b2e9a74 (diff)
evas - software x11 - lock shmpool as now shm pool entities are threaded
recent changes moved shm buffer pushig to a thread and thus shm pool has to be locked too
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/software_x11/evas_xcb_outbuf.c7
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_outbuf.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/evas/engines/software_x11/evas_xcb_outbuf.c b/src/modules/evas/engines/software_x11/evas_xcb_outbuf.c
index e1e8287713..e68a0928df 100644
--- a/src/modules/evas/engines/software_x11/evas_xcb_outbuf.c
+++ b/src/modules/evas/engines/software_x11/evas_xcb_outbuf.c
@@ -33,12 +33,14 @@ static int _shmsize = 0;
33static int _shmlimit = (10 * 1024 * 1024); 33static int _shmlimit = (10 * 1024 * 1024);
34static const unsigned int _shmcountlimit = 32; 34static const unsigned int _shmcountlimit = 32;
35 35
36#define SHMPOOL_LOCK() 36static Eina_Spinlock shmpool_lock;
37#define SHMPOOL_UNLOCK() 37#define SHMPOOL_LOCK() eina_spinlock_take(&shmpool_lock)
38#define SHMPOOL_UNLOCK() eina_spinlock_release(&shmpool_lock)
38 39
39void 40void
40evas_software_xcb_outbuf_init(void) 41evas_software_xcb_outbuf_init(void)
41{ 42{
43 eina_spinlock_new(&shmpool_lock);
42} 44}
43 45
44void 46void
@@ -83,6 +85,7 @@ evas_software_xcb_outbuf_free(Outbuf *buf)
83 85
84 free(buf); 86 free(buf);
85 _clear_xcbob(EINA_FALSE); 87 _clear_xcbob(EINA_FALSE);
88 eina_spinlock_free(&shmpool_lock);
86} 89}
87 90
88Outbuf * 91Outbuf *
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
index 42d26aed1d..a6ba9c3e66 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_outbuf.c
@@ -31,8 +31,9 @@ static int shmsize = 0;
31static int shmmemlimit = 10 * 1024 * 1024; 31static int shmmemlimit = 10 * 1024 * 1024;
32static const unsigned int shmcountlimit = 32; 32static const unsigned int shmcountlimit = 32;
33 33
34#define SHMPOOL_LOCK() 34static Eina_Spinlock shmpool_lock;
35#define SHMPOOL_UNLOCK() 35#define SHMPOOL_LOCK() eina_spinlock_take(&shmpool_lock)
36#define SHMPOOL_UNLOCK() eina_spinlock_release(&shmpool_lock)
36 37
37static X_Output_Buffer * 38static X_Output_Buffer *
38_find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data) 39_find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data)
@@ -146,6 +147,7 @@ _clear_xob(int psync)
146void 147void
147evas_software_xlib_outbuf_init(void) 148evas_software_xlib_outbuf_init(void)
148{ 149{
150 eina_spinlock_new(&shmpool_lock);
149} 151}
150 152
151void 153void
@@ -187,6 +189,7 @@ evas_software_xlib_outbuf_free(Outbuf *buf)
187 eina_array_flush(&buf->priv.onebuf_regions); 189 eina_array_flush(&buf->priv.onebuf_regions);
188 free(buf); 190 free(buf);
189 _clear_xob(0); 191 _clear_xob(0);
192 eina_spinlock_free(&shmpool_lock);
190} 193}
191 194
192Outbuf * 195Outbuf *