diff --git a/src/crystal/task.py b/src/crystal/task.py index 7130a3c6..fad07906 100644 --- a/src/crystal/task.py +++ b/src/crystal/task.py @@ -257,7 +257,6 @@ def append_child(self, child: Task, *, already_complete_ok: bool=False) -> None: def finish(self) -> None: """ Marks this task as completed. - Threadsafe. """ # Mark as complete immediately, because caller may check this task's complete status self._complete = True @@ -1310,6 +1309,12 @@ def __init__(self): super().__init__(title='ROOT') self.subtitle = 'Running' + @property # type: ignore[misc] + @fg_affinity # force any access to synchronize with foreground thread + @overrides + def children(self) -> List[Task]: + return super().children + @overrides def append_child(self, child: Task, *args, **kwargs) -> None: """