class Async::Task

def make_fiber(&block)

def make_fiber(&block)
	Fiber.new do |*arguments|
		set!
		
		begin
			@result = yield(self, *arguments)
			@status = :complete
			# logger.debug(self) {"Task was completed with #{@children.size} children!"}
		rescue Stop
			stop!
		rescue StandardError => error
			fail!(error, false)
		rescue Exception => exception
			fail!(exception, true)
		ensure
			# logger.debug(self) {"Task ensure $!=#{$!} with #{@children.size} children!"}
			finish!
		end
	end
end