mutex all access to thr_mining