use spinlocks on SheepShaver/Linux/PPC, and possibly others where spinlocks

are available. TODO: check the fastest & safest means to lock VOSF stuff.
This commit is contained in:
gbeauche 2003-09-29 08:27:24 +00:00
parent 23c4ebcdf3
commit f9dd276a47

View File

@ -171,6 +171,10 @@ static inline int find_next_page_clear(int page)
static pthread_mutex_t vosf_lock = PTHREAD_MUTEX_INITIALIZER; // Mutex to protect frame buffer (dirtyPages in fact)
#define LOCK_VOSF pthread_mutex_lock(&vosf_lock);
#define UNLOCK_VOSF pthread_mutex_unlock(&vosf_lock);
#elif defined(HAVE_SPINLOCKS)
static spinlock_t vosf_lock = SPIN_LOCK_UNLOCKED; // Mutex to protect frame buffer (dirtyPages in fact)
#define LOCK_VOSF spin_lock(&vosf_lock)
#define UNLOCK_VOSF spin_unlock(&vosf_lock)
#else
#define LOCK_VOSF
#define UNLOCK_VOSF