Added Thread safe cache class.