folly/folly/futures/Future.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/futures/Future.h>

#include <folly/Likely.h>
#include <folly/Singleton.h>
#include <folly/futures/HeapTimekeeper.h>
#include <folly/futures/ThreadWheelTimekeeper.h>
#include <folly/portability/GFlags.h>

FOLLY_GFLAGS_DEFINE_bool();

namespace folly {
namespace futures {

namespace detail {

void WithinInterruptHandler::operator()(exception_wrapper const& ew) const {}

void WithinAfterFutureCallback::operator()(Try<Unit>&& t) {}

} // namespace detail

SemiFuture<Unit> sleep(HighResDuration dur, Timekeeper* tk) {}

Future<Unit> sleepUnsafe(HighResDuration dur, Timekeeper* tk) {}

namespace {
template <typename Ptr>
class FutureWaiter : public fibers::Baton::Waiter {};
} // namespace

SemiFuture<Unit> wait(std::unique_ptr<fibers::Baton> baton) {}
SemiFuture<Unit> wait(std::shared_ptr<fibers::Baton> baton) {}

} // namespace futures

namespace detail {

namespace {
Singleton<Timekeeper, TimekeeperSingletonTag> gTimekeeperSingleton(
    []() -> Timekeeper* {});
} // namespace

std::shared_ptr<Timekeeper> getTimekeeperSingleton() {}

} // namespace detail

#if FOLLY_USE_EXTERN_FUTURE_UNIT
namespace futures {
namespace detail {
template class FutureBase<Unit>;
} // namespace detail
} // namespace futures

template class Future<Unit>;
template class SemiFuture<Unit>;
#endif

} // namespace folly