Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
partial Merge bitcoin#19090: refactor: Misc scheduler cleanups
Browse files Browse the repository at this point in the history
backports bitcoin/bitcoin@fab2950 doc: Switch boost::thread to std::thread in scheduler

After commit d0ebd93 the scheduler itself no longer cares if the
serviceQueue is run in a std::thread or boost::thread. Change the
documentation to std::thread because we switched to C++11.
  • Loading branch information
MarcoFalke authored and gades committed Dec 9, 2023
1 parent ec01572 commit 6221f6c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
#ifndef BITCOIN_SCHEDULER_H
#define BITCOIN_SCHEDULER_H

//
// NOTE:
// boost::thread should be ported to std::thread
// when we support C++11.
//
#include <condition_variable>
#include <functional>
#include <list>
Expand All @@ -27,7 +22,7 @@
// CScheduler* s = new CScheduler();
// s->scheduleFromNow(doSomething, 11); // Assuming a: void doSomething() { }
// s->scheduleFromNow(std::bind(Class::func, this, argument), 3);
// boost::thread* t = new boost::thread(std::bind(CScheduler::serviceQueue, s));
// std::thread* t = new std::thread([&] { s->serviceQueue(); });
//
// ... then at program shutdown, make sure to call stop() to clean up the thread(s) running serviceQueue:
// s->stop();
Expand Down

0 comments on commit 6221f6c

Please sign in to comment.