mutex threads and connections