Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35027

Add makePromiseFuturePair() helper to util/future.h

    XMLWordPrintable

    Details

      Description

      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>();
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-platform DO NOT USE - Backlog - Platform Team
              Reporter:
              jason.carey Jason Carey
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: