mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 18:05:58 +02:00
CScheduler boost->std::function, use millisecs for times, not secs
This commit is contained in:
@@ -104,20 +104,20 @@ void CScheduler::schedule(CScheduler::Function f, boost::chrono::system_clock::t
|
||||
newTaskScheduled.notify_one();
|
||||
}
|
||||
|
||||
void CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaSeconds)
|
||||
void CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaMilliSeconds)
|
||||
{
|
||||
schedule(f, boost::chrono::system_clock::now() + boost::chrono::seconds(deltaSeconds));
|
||||
schedule(f, boost::chrono::system_clock::now() + boost::chrono::milliseconds(deltaMilliSeconds));
|
||||
}
|
||||
|
||||
static void Repeat(CScheduler* s, CScheduler::Function f, int64_t deltaSeconds)
|
||||
static void Repeat(CScheduler* s, CScheduler::Function f, int64_t deltaMilliSeconds)
|
||||
{
|
||||
f();
|
||||
s->scheduleFromNow(boost::bind(&Repeat, s, f, deltaSeconds), deltaSeconds);
|
||||
s->scheduleFromNow(boost::bind(&Repeat, s, f, deltaMilliSeconds), deltaMilliSeconds);
|
||||
}
|
||||
|
||||
void CScheduler::scheduleEvery(CScheduler::Function f, int64_t deltaSeconds)
|
||||
void CScheduler::scheduleEvery(CScheduler::Function f, int64_t deltaMilliSeconds)
|
||||
{
|
||||
scheduleFromNow(boost::bind(&Repeat, this, f, deltaSeconds), deltaSeconds);
|
||||
scheduleFromNow(boost::bind(&Repeat, this, f, deltaMilliSeconds), deltaMilliSeconds);
|
||||
}
|
||||
|
||||
size_t CScheduler::getQueueInfo(boost::chrono::system_clock::time_point &first,
|
||||
|
||||
Reference in New Issue
Block a user