(wangle) Use an atomic_flag to make FutureObject threadsafe