Browse Source

Don't yield on grabbing the read lock variant of cglocks.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
736dfb4075
  1. 9
      miner.h

9
miner.h

@ -721,10 +721,15 @@ static inline void mutex_lock(pthread_mutex_t *lock)
quit(1, "WTF MUTEX ERROR ON LOCK!"); quit(1, "WTF MUTEX ERROR ON LOCK!");
} }
static inline void mutex_unlock(pthread_mutex_t *lock) static inline void mutex_unlock_noyield(pthread_mutex_t *lock)
{ {
if (unlikely(pthread_mutex_unlock(lock))) if (unlikely(pthread_mutex_unlock(lock)))
quit(1, "WTF MUTEX ERROR ON UNLOCK!"); quit(1, "WTF MUTEX ERROR ON UNLOCK!");
}
static inline void mutex_unlock(pthread_mutex_t *lock)
{
mutex_unlock_noyield(lock);
sched_yield(); sched_yield();
} }
@ -793,7 +798,7 @@ static inline void cg_rlock(cglock_t *lock)
{ {
mutex_lock(&lock->mutex); mutex_lock(&lock->mutex);
rd_lock(&lock->rwlock); rd_lock(&lock->rwlock);
mutex_unlock(&lock->mutex); mutex_unlock_noyield(&lock->mutex);
} }
/* Intermediate variant of cglock */ /* Intermediate variant of cglock */

Loading…
Cancel
Save