Make thread save.