class Async::Task

def stopped!

def stopped!
	# Console.info(self, status:) {"Task #{self} was stopped with #{@children&.size.inspect} children!"}
	@status = :stopped
	
	stopped = false
	
	begin
		# We are not running, but children might be so we should stop them:
		stop_children(true)
	rescue Stop
		stopped = true
		# If we are stopping children, and one of them tries to stop the current task, we should ignore it. We will be stopped later.
		retry
	end
	
	if stopped
		raise Stop, "Stopping current task!"
	end
end