mutex all access to mining_thr