make rw locks: mining_thr_lock and devices_lock