#include <folly/fibers/FiberManagerInternal.h>
#include <csignal>
#include <cassert>
#include <stdexcept>
#include <glog/logging.h>
#include <folly/fibers/Fiber.h>
#include <folly/fibers/LoopController.h>
#include <folly/ConstexprMath.h>
#include <folly/SingletonThreadLocal.h>
#include <folly/memory/SanitizeAddress.h>
#include <folly/portability/Config.h>
#include <folly/portability/SysSyscall.h>
#include <folly/portability/Unistd.h>
#include <folly/synchronization/SanitizeThread.h>
namespace std {
template <>
struct hash<folly::fibers::FiberManager::Options> { … };
}
namespace folly {
namespace fibers {
void FiberManager::defaultExceptionCallback(
const std::exception_ptr& eptr, StringPiece context) { … }
auto FiberManager::FrozenOptions::create(const Options& options) -> ssize_t { … }
FiberManager*& FiberManager::getCurrentFiberManager() { … }
FiberManager::FiberManager(
std::unique_ptr<LoopController> loopController, Options options)
: … { … }
FiberManager::~FiberManager() { … }
LoopController& FiberManager::loopController() { … }
const LoopController& FiberManager::loopController() const { … }
bool FiberManager::hasTasks() const { … }
bool FiberManager::isRemoteScheduled() const { … }
Fiber* FiberManager::getFiber() { … }
void FiberManager::setExceptionCallback(FiberManager::ExceptionCallback ec) { … }
size_t FiberManager::fibersAllocated() const { … }
size_t FiberManager::fibersPoolSize() const { … }
size_t FiberManager::stackHighWatermark() const { … }
void FiberManager::remoteReadyInsert(Fiber* fiber) { … }
void FiberManager::addObserver(ExecutionObserver* observer) { … }
void FiberManager::removeObserver(ExecutionObserver* observer) { … }
ExecutionObserver::List& FiberManager::getObserverList() { … }
void FiberManager::setPreemptRunner(InlineFunctionRunner* preemptRunner) { … }
void FiberManager::doFibersPoolResizing() { … }
void FiberManager::FibersPoolResizer::run() { … }
void FiberManager::registerStartSwitchStackWithAsan(
void** saveFakeStack, const void* stackBottom, size_t stackSize) { … }
void FiberManager::registerFinishSwitchStackWithAsan(
void* saveFakeStack, const void** saveStackBottom, size_t* saveStackSize) { … }
void FiberManager::freeFakeStack(void* fakeStack) { … }
void FiberManager::unpoisonFiberStack(const Fiber* fiber) { … }
#if defined(SIGSTKSZ) && !FOLLY_APPLE_TVOS && !FOLLY_APPLE_WATCHOS
namespace {
bool hasAlternateStack() { … }
int setAlternateStack(char* sp, size_t size) { … }
int unsetAlternateStack() { … }
class ScopedAlternateSignalStack { … };
}
void FiberManager::maybeRegisterAlternateSignalStack() { … }
#else
void FiberManager::maybeRegisterAlternateSignalStack() {
}
#endif
}
}