Do not call write code unless able to get a lock