Browse Source

It is not critical getting the temperature response in bitforce so don't mandatorily wait on the mutex lock.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
7fa794a499
  1. 6
      driver-bitforce.c
  2. 5
      miner.h

6
driver-bitforce.c

@ -241,7 +241,11 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce) @@ -241,7 +241,11 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
if (!fdDev)
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);
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
mutex_unlock(&bitforce->device_mutex);

5
miner.h

@ -500,6 +500,11 @@ static inline void mutex_unlock(pthread_mutex_t *lock) @@ -500,6 +500,11 @@ static inline void mutex_unlock(pthread_mutex_t *lock)
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)
{
if (unlikely(pthread_rwlock_wrlock(lock)))

Loading…
Cancel
Save