code: def _execute_wakeup_tasks(self):
      
      # Check the length of wakeup tasks first to avoid concurrent issues
      size = len(self.wakeup_tasks)
      for i in range(size):
        self.wakeup_tasks[i]()
docs: Executes wakeup tasks, should only be called from loop()