class Async::Promise

def resolve(value)

@parameter value [Object] The value to resolve the promise with.

Can only be called once - subsequent calls are ignored.
All current and future waiters will receive this value.
Resolve the promise with a value.
def resolve(value)
	@mutex.synchronize do
		return if @resolved
		
		@resolved = :completed
		@value = value
		
		# Wake up all waiting fibers:
		@condition.broadcast
	end
	
	return value
end