Stop the timer without executing the callback.

def cancel(self):
        """Stop the timer without executing the callback."""
        self._cancelled.set()
        if not self._dead:
            self._ready_sem.acquire()
            self._ready_sem.release()