Changeset View
Changeset View
Standalone View
Standalone View
src/threadinterrupt.h
Show All 22 Lines | public: | ||||
void operator()(); | void operator()(); | ||||
void reset(); | void reset(); | ||||
bool sleep_for(std::chrono::milliseconds rel_time); | bool sleep_for(std::chrono::milliseconds rel_time); | ||||
bool sleep_for(std::chrono::seconds rel_time); | bool sleep_for(std::chrono::seconds rel_time); | ||||
bool sleep_for(std::chrono::minutes rel_time); | bool sleep_for(std::chrono::minutes rel_time); | ||||
private: | private: | ||||
std::condition_variable cond; | std::condition_variable cond; | ||||
CWaitableCriticalSection mut; | Mutex mut; | ||||
std::atomic<bool> flag; | std::atomic<bool> flag; | ||||
}; | }; | ||||
#endif // BITCOIN_THREADINTERRUPT_H | #endif // BITCOIN_THREADINTERRUPT_H |