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
This commit is contained in:
Carsten Haitzler 2015-09-28 02:55:13 +09:00
parent 08e4f0ce8d
commit 4b894e01b5
2 changed files with 10 additions and 4 deletions

View File

@ -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 *

View File

@ -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 *