Added thread locking to the NameParse class