Commit 736dfb407586298b14eb6b435d0d6df363a15698

Con Kolivas 2013-06-15T12:35:16

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

diff --git a/miner.h b/miner.h
index bcc3c03..942e2a0 100644
--- a/miner.h
+++ b/miner.h
@@ -721,10 +721,15 @@ static inline void mutex_lock(pthread_mutex_t *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)))
 		quit(1, "WTF MUTEX ERROR ON UNLOCK!");
+}
+
+static inline void mutex_unlock(pthread_mutex_t *lock)
+{
+	mutex_unlock_noyield(lock);
 	sched_yield();
 }
 
@@ -793,7 +798,7 @@ static inline void cg_rlock(cglock_t *lock)
 {
 	mutex_lock(&lock->mutex);
 	rd_lock(&lock->rwlock);
-	mutex_unlock(&lock->mutex);
+	mutex_unlock_noyield(&lock->mutex);
 }
 
 /* Intermediate variant of cglock */