kernel: Remove dependency on CScheduler

By defining a virtual interface class for the scheduler client, users of
the kernel can now define their own event consuming infrastructure,
without having to spawn threads or rely on the scheduler design.

Removing CScheduler also allows removing the thread and
exception modules from the kernel library.
This commit is contained in:
TheCharlatan
2023-11-27 17:15:11 +01:00
parent 06069b3913
commit d5228efb53
8 changed files with 85 additions and 37 deletions

View File

@@ -17,11 +17,14 @@
#include <memory>
#include <vector>
namespace util {
class TaskRunnerInterface;
} // namespace util
class BlockValidationState;
class CBlock;
class CBlockIndex;
struct CBlockLocator;
class CScheduler;
enum class MemPoolRemovalReason;
struct RemovedMempoolTransactionInfo;
struct NewMempoolTransactionInfo;
@@ -160,7 +163,10 @@ private:
std::unique_ptr<ValidationSignalsImpl> m_internals;
public:
ValidationSignals(CScheduler& scheduler LIFETIMEBOUND);
// The task runner will block validation if it calls its insert method's
// func argument synchronously. In this class func contains a loop that
// dispatches a single validation event to all subscribers sequentially.
explicit ValidationSignals(std::unique_ptr<util::TaskRunnerInterface> task_runner);
~ValidationSignals();