Browse Source

Provide locking around updates of cgpu hashrates as well to prevent multiple threads accessing data fields on the same device.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
ef1eafa40a
  1. 2
      cgminer.c

2
cgminer.c

@ -2936,8 +2936,10 @@ static void hashmeter(int thr_id, struct timeval *diff, @@ -2936,8 +2936,10 @@ static void hashmeter(int thr_id, struct timeval *diff,
if (th->cgpu == cgpu)
thread_rolling += th->rolling;
}
mutex_lock(&hash_lock);
decay_time(&cgpu->rolling, thread_rolling);
cgpu->total_mhashes += local_mhashes;
mutex_unlock(&hash_lock);
// If needed, output detailed, per-device stats
if (want_per_device_stats) {

Loading…
Cancel
Save