raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4b894e01b5bf2218e39a0727f12edc1f61f9e9b0

commit 4b894e01b5bf2218e39a0727f12edc1f61f9e9b0
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Mon Sep 28 02:55:13 2015 +0900

    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
---
 src/modules/evas/engines/software_x11/evas_xcb_outbuf.c  | 7 +++++--
 src/modules/evas/engines/software_x11/evas_xlib_outbuf.c | 7 +++++--
 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 e1e8287..e68a092 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;
 static int _shmlimit = (10 * 1024 * 1024);
 static const unsigned int _shmcountlimit = 32;
 
-#define SHMPOOL_LOCK()
-#define SHMPOOL_UNLOCK()
+static Eina_Spinlock shmpool_lock;
+#define SHMPOOL_LOCK() eina_spinlock_take(&shmpool_lock)
+#define SHMPOOL_UNLOCK() eina_spinlock_release(&shmpool_lock)
 
 void 
 evas_software_xcb_outbuf_init(void) 
 {
+   eina_spinlock_new(&shmpool_lock);
 }
 
 void 
@@ -83,6 +85,7 @@ evas_software_xcb_outbuf_free(Outbuf *buf)
 
    free(buf);
    _clear_xcbob(EINA_FALSE);
+   eina_spinlock_free(&shmpool_lock);
 }
 
 Outbuf *
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 42d26ae..a6ba9c3 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;
 static int shmmemlimit = 10 * 1024 * 1024;
 static const unsigned int shmcountlimit = 32;
 
-#define SHMPOOL_LOCK()
-#define SHMPOOL_UNLOCK()
+static Eina_Spinlock shmpool_lock;
+#define SHMPOOL_LOCK() eina_spinlock_take(&shmpool_lock)
+#define SHMPOOL_UNLOCK() eina_spinlock_release(&shmpool_lock)
 
 static X_Output_Buffer *
 _find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data)
@@ -146,6 +147,7 @@ _clear_xob(int psync)
 void
 evas_software_xlib_outbuf_init(void)
 {
+   eina_spinlock_new(&shmpool_lock);
 }
 
 void
@@ -187,6 +189,7 @@ evas_software_xlib_outbuf_free(Outbuf *buf)
    eina_array_flush(&buf->priv.onebuf_regions);
    free(buf);
    _clear_xob(0);
+   eina_spinlock_free(&shmpool_lock);
 }
 
 Outbuf *

-- 


Reply via email to