Page MenuHomePhabricator

eventloop.h
No OneTemporary

eventloop.h

// Copyright (c) 2020 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_EVENTLOOP_H
#define BITCOIN_EVENTLOOP_H
#include <sync.h>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <functional>
class CScheduler;
struct EventLoop {
public:
EventLoop() {}
~EventLoop();
bool startEventLoop(CScheduler &scheduler,
std::function<void()> runEventLoop,
std::chrono::milliseconds delta);
bool stopEventLoop();
private:
/**
* Start stop machinery.
*/
std::atomic<bool> stopRequest{false};
bool running GUARDED_BY(cs_running) = false;
Mutex cs_running;
std::condition_variable cond_running;
};
#endif // BITCOIN_EVENTLOOP_H

File Metadata

Mime Type
text/x-c++
Expires
Sat, Nov 23, 09:55 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4511162
Default Alt Text
eventloop.h (870 B)

Event Timeline