aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.h
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-10 10:59:18 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-10 10:54:54 +0200
commitfa9051642269f62f560af3f323fbf36cb7b58082 (patch)
treec5ad25ea4c251ee30f40fa6229682aaef52ec7ab /src/scheduler.h
parentfb7c12c26f57784c6db589939103237173adb533 (diff)
downloadbitcoin-fa9051642269f62f560af3f323fbf36cb7b58082.tar.xz
Switch scheduler to steady_clock
Diffstat (limited to 'src/scheduler.h')
-rw-r--r--src/scheduler.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scheduler.h b/src/scheduler.h
index eb350e4bc3..b8245f97ed 100644
--- a/src/scheduler.h
+++ b/src/scheduler.h
@@ -46,12 +46,12 @@ public:
typedef std::function<void()> Function;
/** Call func at/after time t */
- void schedule(Function f, std::chrono::system_clock::time_point t);
+ void schedule(Function f, std::chrono::steady_clock::time_point t);
/** Call f once after the delta has passed */
void scheduleFromNow(Function f, std::chrono::milliseconds delta)
{
- schedule(std::move(f), std::chrono::system_clock::now() + delta);
+ schedule(std::move(f), std::chrono::steady_clock::now() + delta);
}
/**
@@ -93,8 +93,8 @@ public:
* Returns number of tasks waiting to be serviced,
* and first and last task times
*/
- size_t getQueueInfo(std::chrono::system_clock::time_point& first,
- std::chrono::system_clock::time_point& last) const;
+ size_t getQueueInfo(std::chrono::steady_clock::time_point& first,
+ std::chrono::steady_clock::time_point& last) const;
/** Returns true if there are threads actively running in serviceQueue() */
bool AreThreadsServicingQueue() const;
@@ -102,7 +102,7 @@ public:
private:
mutable Mutex newTaskMutex;
std::condition_variable newTaskScheduled;
- std::multimap<std::chrono::system_clock::time_point, Function> taskQueue GUARDED_BY(newTaskMutex);
+ std::multimap<std::chrono::steady_clock::time_point, Function> taskQueue GUARDED_BY(newTaskMutex);
int nThreadsServicingQueue GUARDED_BY(newTaskMutex){0};
bool stopRequested GUARDED_BY(newTaskMutex){false};
bool stopWhenEmpty GUARDED_BY(newTaskMutex){false};