def __init__(self) -> None:
        """Create a new instance of :class:`CriticalTask`.

        Instantiate the lock and the task control attributes.
        """
        self._lock = Lock()
        self.is_cancelled = False
        self.result = None
Create a new instance of :class:`CriticalTask`.

        Instantiate the lock and the task control attributes.
        
patroni/async_executor.py