thread cpp modification