eden/fs/takeover/test/TakeoverTest.cpp
/**
 * Run takeoverMounts() in a separate thread, and return a Future that will
 * complete in the specified EventBase once takeoverMounts() finishes.
 */
Run takeoverMounts() in a separate thread, and return a Future that will
complete in the specified EventBase once takeoverMounts() finishes.
Run takeoverMounts () in a separate thread and return a Future that will complete in the specified EventBase once takeoverMounts () finishes .
Future<TakeoverData> takeoverViaEventBase(
    EventBase* evb,
    AbsolutePathPiece socketPath,
    const std::set<int32_t>& supportedVersions) {
  Promise<TakeoverData> promise;
  auto future = promise.getFuture();
  std::thread thread([path = AbsolutePath{socketPath},
                      supportedVersions,
                      promise = std::move(promise)]() mutable {
    promise.setWith([&] { return takeoverMounts(path, supportedVersions); });
  });
  return future.via(evb).ensure(
      [t = std::move(thread)]() mutable { t.join(); });
}
Future < TakeoverData > takeoverViaEventBase ( EventBase * evb , AbsolutePathPiece socketPath , const std :: set < int32_t > & supportedVersions ) { Promise < TakeoverData > promise ; auto future = promise . getFuture ( ) ; std :: thread thread ( [ path = AbsolutePath { socketPath } , supportedVersions , promise = std :: move ( promise ) ] ( ) mutable { promise . setWith ( [ & ] { return takeoverMounts ( path , supportedVersions ) ; } ) ; } ) ; return future . via ( evb ) . ensure ( [ t = std :: move ( thread ) ] ( ) mutable { t . join ( ) ; } ) ; }
Run takeoverMounts() in a separate thread, and return a Future that will
 complete in the specified EventBase once takeoverMounts() finishes.
Run takeoverMounts () in a separate thread and return a Future that will complete in the specified EventBase once takeoverMounts () finishes .