mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-04 19:14:26 +00:00
Don't yield on grabbing the read lock variant of cglocks.
This commit is contained in:
parent
6789c96fd4
commit
736dfb4075
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!");
|
||||
}
|
||||
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user