| 168 |
#endif |
#endif |
| 169 |
|
|
| 170 |
// Mutex to protect palette |
// Mutex to protect palette |
| 171 |
#ifdef HAVE_SPINLOCKS |
#if defined(HAVE_PTHREADS) |
|
static spinlock_t x_palette_lock = SPIN_LOCK_UNLOCKED; |
|
|
#define LOCK_PALETTE spin_lock(&x_palette_lock) |
|
|
#define UNLOCK_PALETTE spin_unlock(&x_palette_lock) |
|
|
#elif defined(HAVE_PTHREADS) |
|
| 172 |
static pthread_mutex_t x_palette_lock = PTHREAD_MUTEX_INITIALIZER; |
static pthread_mutex_t x_palette_lock = PTHREAD_MUTEX_INITIALIZER; |
| 173 |
#define LOCK_PALETTE pthread_mutex_lock(&x_palette_lock) |
#define LOCK_PALETTE pthread_mutex_lock(&x_palette_lock) |
| 174 |
#define UNLOCK_PALETTE pthread_mutex_unlock(&x_palette_lock) |
#define UNLOCK_PALETTE pthread_mutex_unlock(&x_palette_lock) |
| 175 |
|
#elif defined(HAVE_SPINLOCKS) |
| 176 |
|
static spinlock_t x_palette_lock = SPIN_LOCK_UNLOCKED; |
| 177 |
|
#define LOCK_PALETTE spin_lock(&x_palette_lock) |
| 178 |
|
#define UNLOCK_PALETTE spin_unlock(&x_palette_lock) |
| 179 |
#else |
#else |
| 180 |
#define LOCK_PALETTE |
#define LOCK_PALETTE |
| 181 |
#define UNLOCK_PALETTE |
#define UNLOCK_PALETTE |
| 182 |
#endif |
#endif |
| 183 |
|
|
| 184 |
// Mutex to protect frame buffer |
// Mutex to protect frame buffer |
| 185 |
#ifdef HAVE_SPINLOCKS |
#if defined(HAVE_PTHREADS) |
|
static spinlock_t frame_buffer_lock = SPIN_LOCK_UNLOCKED; |
|
|
#define LOCK_FRAME_BUFFER spin_lock(&frame_buffer_lock) |
|
|
#define UNLOCK_FRAME_BUFFER spin_unlock(&frame_buffer_lock) |
|
|
#elif defined(HAVE_PTHREADS) |
|
| 186 |
static pthread_mutex_t frame_buffer_lock = PTHREAD_MUTEX_INITIALIZER; |
static pthread_mutex_t frame_buffer_lock = PTHREAD_MUTEX_INITIALIZER; |
| 187 |
#define LOCK_FRAME_BUFFER pthread_mutex_lock(&frame_buffer_lock); |
#define LOCK_FRAME_BUFFER pthread_mutex_lock(&frame_buffer_lock); |
| 188 |
#define UNLOCK_FRAME_BUFFER pthread_mutex_unlock(&frame_buffer_lock); |
#define UNLOCK_FRAME_BUFFER pthread_mutex_unlock(&frame_buffer_lock); |
| 189 |
|
#elif defined(HAVE_SPINLOCKS) |
| 190 |
|
static spinlock_t frame_buffer_lock = SPIN_LOCK_UNLOCKED; |
| 191 |
|
#define LOCK_FRAME_BUFFER spin_lock(&frame_buffer_lock) |
| 192 |
|
#define UNLOCK_FRAME_BUFFER spin_unlock(&frame_buffer_lock) |
| 193 |
#else |
#else |
| 194 |
#define LOCK_FRAME_BUFFER |
#define LOCK_FRAME_BUFFER |
| 195 |
#define UNLOCK_FRAME_BUFFER |
#define UNLOCK_FRAME_BUFFER |