Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <scheduler.h>
Public Types | |
typedef std::function< void(void)> | Function |
Public Member Functions | |
CScheduler () | |
~CScheduler () | |
void | schedule (Function f, boost::chrono::system_clock::time_point t=boost::chrono::system_clock::now()) |
void | scheduleFromNow (Function f, int64_t deltaMilliSeconds) |
void | scheduleEvery (Function f, int64_t deltaMilliSeconds) |
void | serviceQueue () |
void | stop (bool drain=false) |
size_t | getQueueInfo (boost::chrono::system_clock::time_point &first, boost::chrono::system_clock::time_point &last) const |
bool | AreThreadsServicingQueue () const |
Private Member Functions | |
bool | shouldStop () const |
Private Attributes | |
std::multimap< boost::chrono::system_clock::time_point, Function > | taskQueue |
boost::condition_variable | newTaskScheduled |
boost::mutex | newTaskMutex |
int | nThreadsServicingQueue |
bool | stopRequested |
bool | stopWhenEmpty |
Detailed Description
Definition at line 37 of file scheduler.h.
Member Typedef Documentation
◆ Function
typedef std::function<void(void)> CScheduler::Function |
Definition at line 43 of file scheduler.h.
Constructor & Destructor Documentation
◆ CScheduler()
CScheduler::CScheduler | ( | ) |
Definition at line 14 of file scheduler.cpp.
◆ ~CScheduler()
CScheduler::~CScheduler | ( | ) |
Definition at line 18 of file scheduler.cpp.
References nThreadsServicingQueue.
Member Function Documentation
◆ AreThreadsServicingQueue()
bool CScheduler::AreThreadsServicingQueue | ( | ) | const |
Definition at line 143 of file scheduler.cpp.
References newTaskMutex, and nThreadsServicingQueue.
Referenced by SingleThreadedSchedulerClient::EmptyQueue().
◆ getQueueInfo()
size_t CScheduler::getQueueInfo | ( | boost::chrono::system_clock::time_point & | first, |
boost::chrono::system_clock::time_point & | last | ||
) | const |
Definition at line 131 of file scheduler.cpp.
References newTaskMutex, and taskQueue.
◆ schedule()
void CScheduler::schedule | ( | CScheduler::Function | f, |
boost::chrono::system_clock::time_point | t = boost::chrono::system_clock::now() |
||
) |
Definition at line 106 of file scheduler.cpp.
References newTaskMutex, newTaskScheduled, and taskQueue.
Referenced by SingleThreadedSchedulerClient::MaybeScheduleProcessQueue(), and scheduleFromNow().
◆ scheduleEvery()
void CScheduler::scheduleEvery | ( | CScheduler::Function | f, |
int64_t | deltaMilliSeconds | ||
) |
Definition at line 126 of file scheduler.cpp.
References Repeat(), and scheduleFromNow().
Referenced by AppInitMain(), PeerLogicValidation::PeerLogicValidation(), WalletInit::Start(), llmq::CChainLocksHandler::Start(), and CConnman::Start().
◆ scheduleFromNow()
void CScheduler::scheduleFromNow | ( | CScheduler::Function | f, |
int64_t | deltaMilliSeconds | ||
) |
Definition at line 115 of file scheduler.cpp.
References schedule().
Referenced by llmq::CChainLocksHandler::ProcessNewChainLock(), Repeat(), scheduleEvery(), and llmq::CChainLocksHandler::UpdatedBlockTip().
◆ serviceQueue()
void CScheduler::serviceQueue | ( | ) |
Definition at line 33 of file scheduler.cpp.
References newTaskMutex, newTaskScheduled, nThreadsServicingQueue, RandAddSeedSleep(), shouldStop(), taskQueue, and toPosixTime().
Referenced by AppInitMain(), and llmq::CChainLocksHandler::CChainLocksHandler().
◆ shouldStop()
|
inlineprivate |
Definition at line 84 of file scheduler.h.
References stopRequested, stopWhenEmpty, and taskQueue.
Referenced by serviceQueue().
◆ stop()
void CScheduler::stop | ( | bool | drain = false | ) |
Definition at line 94 of file scheduler.cpp.
References newTaskMutex, newTaskScheduled, stopRequested, and stopWhenEmpty.
Referenced by llmq::CChainLocksHandler::Stop().
Member Data Documentation
◆ newTaskMutex
|
mutableprivate |
Definition at line 80 of file scheduler.h.
Referenced by AreThreadsServicingQueue(), getQueueInfo(), schedule(), serviceQueue(), and stop().
◆ newTaskScheduled
|
private |
Definition at line 79 of file scheduler.h.
Referenced by schedule(), serviceQueue(), and stop().
◆ nThreadsServicingQueue
|
private |
Definition at line 81 of file scheduler.h.
Referenced by AreThreadsServicingQueue(), serviceQueue(), and ~CScheduler().
◆ stopRequested
|
private |
Definition at line 82 of file scheduler.h.
Referenced by shouldStop(), and stop().
◆ stopWhenEmpty
|
private |
Definition at line 83 of file scheduler.h.
Referenced by shouldStop(), and stop().
◆ taskQueue
|
private |
Definition at line 78 of file scheduler.h.
Referenced by getQueueInfo(), schedule(), serviceQueue(), and shouldStop().
The documentation for this class was generated from the following files:
- src/scheduler.h
- src/scheduler.cpp