code: def addTask(self, task):
          
          # Try to start task first.  If it fails then we don't need to
          # undo adding it to taskset
          task.initialize(self)
          task.start()
  
          with self._lock_c:
              self.numtasks += 1
              self.taskset.append(task)
docs: Add a task to the task set.