aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-28 09:16:32 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-21 06:02:59 -0400
commitfa8337fcdbcab8368d5bf111c4b2e5acf25e6e22 (patch)
treef19894bab7c954fe39acec3bee40417f18a1e338 /src/scheduler.h
parentfa3d41b5ab8fe62bc2e36c3e1211aace69e6da65 (diff)
downloadbitcoin-fa8337fcdbcab8368d5bf111c4b2e5acf25e6e22.tar.xz
clang-format scheduler
Can easily be reviewed with the git options --ignore-all-space --word-diff-regex=. -U0
Diffstat (limited to 'src/scheduler.h')
-rw-r--r--src/scheduler.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/scheduler.h b/src/scheduler.h
index ffb2572f20..d7fe00d1b4 100644
--- a/src/scheduler.h
+++ b/src/scheduler.h
@@ -84,8 +84,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::system_clock::time_point& first,
+ std::chrono::system_clock::time_point& last) const;
/** Returns true if there are threads actively running in serviceQueue() */
bool AreThreadsServicingQueue() const;
@@ -110,19 +110,20 @@ private:
* B() will be able to observe all of the effects of callback A() which executed
* before it.
*/
-class SingleThreadedSchedulerClient {
+class SingleThreadedSchedulerClient
+{
private:
- CScheduler *m_pscheduler;
+ CScheduler* m_pscheduler;
RecursiveMutex m_cs_callbacks_pending;
- std::list<std::function<void ()>> m_callbacks_pending GUARDED_BY(m_cs_callbacks_pending);
+ std::list<std::function<void()>> m_callbacks_pending GUARDED_BY(m_cs_callbacks_pending);
bool m_are_callbacks_running GUARDED_BY(m_cs_callbacks_pending) = false;
void MaybeScheduleProcessQueue();
void ProcessQueue();
public:
- explicit SingleThreadedSchedulerClient(CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}
+ explicit SingleThreadedSchedulerClient(CScheduler* pschedulerIn) : m_pscheduler(pschedulerIn) {}
/**
* Add a callback to be executed. Callbacks are executed serially
@@ -130,7 +131,7 @@ public:
* Practically, this means that callbacks can behave as if they are executed
* in order by a single thread.
*/
- void AddToProcessQueue(std::function<void ()> func);
+ void AddToProcessQueue(std::function<void()> func);
/**
* Processes all remaining queue members on the calling thread, blocking until queue is empty