Add a mutex to protect histories