YACLib
C++ library for concurrent tasks execution
|
#include <scheduler.hpp>
Public Member Functions | |
bool | IsRunning () const noexcept |
std::uint64_t | GetTimeNs () const noexcept |
void | Schedule (detail::fiber::FiberBase *fiber) |
void | Sleep (std::uint64_t ns) |
void | SleepPreemptive (std::uint64_t ns) |
Static Public Member Functions | |
static void | SetTickLength (std::uint32_t tick) noexcept |
static void | RescheduleCurrent () |
static detail::fiber::FiberBase * | Current () noexcept |
static detail::fiber::FiberBase::Id | GetId () |
static Scheduler * | GetScheduler () noexcept |
static void | Set (Scheduler *scheduler) noexcept |
static void | Suspend () |
Definition at line 24 of file scheduler.hpp.
|
staticnoexcept |
Definition at line 48 of file scheduler.cpp.
References yaclib::fault::sCurrent.
Referenced by yaclib::detail::fiber::GetImpl(), yaclib::detail::fiber::Thread::join(), yaclib::detail::fiber::Set(), yaclib::detail::fiber::FiberQueue::Wait(), and yaclib::detail::fiber::FiberQueue::Wait().
|
static |
Definition at line 52 of file scheduler.cpp.
References yaclib::detail::fiber::FiberBase::GetId(), and yaclib::fault::sCurrent.
Referenced by yaclib::detail::fiber::Thread::joinable(), yaclib::detail::fiber::RecursiveMutex::lock(), yaclib::detail::fiber::RecursiveMutex::LockHelper(), and yaclib::detail::fiber::RecursiveMutex::try_lock().
|
staticnoexcept |
Definition at line 30 of file scheduler.cpp.
References yaclib::fault::sCurrentScheduler.
Referenced by yaclib::detail::fiber::SystemClock::now(), RescheduleCurrent(), yaclib::detail::fiber::ScheduleFiber(), yaclib::detail::fiber::Thread::Thread(), and yaclib::detail::fiber::FiberQueue::Wait().
|
noexcept |
Definition at line 67 of file scheduler.cpp.
Referenced by yaclib::detail::fiber::SystemClock::now(), and Sleep().
|
noexcept |
Definition at line 20 of file scheduler.cpp.
|
static |
Definition at line 102 of file scheduler.cpp.
References GetScheduler(), yaclib::detail::fiber::BiList::PushBack(), and yaclib::fault::sCurrent.
void yaclib::fault::Scheduler::Schedule | ( | detail::fiber::FiberBase * | fiber | ) |
Definition at line 38 of file scheduler.cpp.
References yaclib::detail::fiber::BiList::PushBack(), yaclib::detail::fiber::FiberBase::SetState(), and yaclib::detail::fiber::Waiting.
Referenced by yaclib::detail::fiber::ScheduleFiber(), and yaclib::detail::fiber::Thread::Thread().
Definition at line 34 of file scheduler.cpp.
References yaclib::MakeContract(), and yaclib::fault::sCurrentScheduler.
|
staticnoexcept |
Definition at line 111 of file scheduler.cpp.
References yaclib::MakeContract(), and yaclib::fault::sTickLength.
Referenced by yaclib::fiber::SetFaultTickLength().
void yaclib::fault::Scheduler::Sleep | ( | std::uint64_t | ns | ) |
Definition at line 115 of file scheduler.cpp.
References GetTimeNs(), yaclib::MakeContract(), yaclib::fault::sCurrent, and Suspend().
Referenced by SleepPreemptive().
void yaclib::fault::Scheduler::SleepPreemptive | ( | std::uint64_t | ns | ) |
Definition at line 125 of file scheduler.cpp.
References yaclib::GetFaultSleepTime(), yaclib::detail::GetRandNumber(), yaclib::MakeContract(), Sleep(), and YACLIB_DEBUG.
|
static |
Definition at line 24 of file scheduler.cpp.
References yaclib::fault::sCurrent, and YACLIB_ASSERT.
Referenced by yaclib::detail::fiber::Thread::join(), Sleep(), and yaclib::detail::fiber::FiberQueue::Wait().