1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-27 06:54:36 +00:00

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

This commit is contained in:
Con Kolivas 2012-03-28 21:58:04 +11:00
parent fa5e0675d6
commit ef1eafa40a

View File

@ -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) {