Add makePromiseFuturePair() helper to util/future.h

XMLWordPrintableJSON

    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It would be helpful to have a utility which produced promises and futures in one atomic operation, because actually extracting a future from a promise is a racy operation (for multiple threads extracting the future, and for extracting the future and fulfilling the promise).

      It should probably look something like:

      auto [promise, future] = makePromiseFuturePair<T>();
      

              Assignee:
              DO NOT USE - Backlog - Platform Team
              Reporter:
              Mira Carey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: