Thread class add a task() member function