mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
It is not critical getting the temperature response in bitforce so don't mandatorily wait on the mutex lock.
This commit is contained in:
parent
5118e3ee7c
commit
7fa794a499
@ -241,7 +241,11 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
|
|||||||
if (!fdDev)
|
if (!fdDev)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mutex_lock(&bitforce->device_mutex);
|
/* It is not critical getting temperature so don't get stuck if we
|
||||||
|
* can't grab the mutex here */
|
||||||
|
if (mutex_trylock(&bitforce->device_mutex))
|
||||||
|
return false;
|
||||||
|
|
||||||
BFwrite(fdDev, "ZLX", 3);
|
BFwrite(fdDev, "ZLX", 3);
|
||||||
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
|
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
|
||||||
mutex_unlock(&bitforce->device_mutex);
|
mutex_unlock(&bitforce->device_mutex);
|
||||||
|
5
miner.h
5
miner.h
@ -500,6 +500,11 @@ static inline void mutex_unlock(pthread_mutex_t *lock)
|
|||||||
quit(1, "WTF MUTEX ERROR ON UNLOCK!");
|
quit(1, "WTF MUTEX ERROR ON UNLOCK!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int mutex_trylock(pthread_mutex_t *lock)
|
||||||
|
{
|
||||||
|
return pthread_mutex_trylock(lock);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void wr_lock(pthread_rwlock_t *lock)
|
static inline void wr_lock(pthread_rwlock_t *lock)
|
||||||
{
|
{
|
||||||
if (unlikely(pthread_rwlock_wrlock(lock)))
|
if (unlikely(pthread_rwlock_wrlock(lock)))
|
||||||
|
Loading…
Reference in New Issue
Block a user