Bitcoin Core 30.99.0
P2P Digital Currency
threadinterrupt.cpp
Go to the documentation of this file.
1// Copyright (c) 2024-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <test/fuzz/util.h>
7
9 : m_fuzzed_data_provider{fuzzed_data_provider}
10{
11}
12
14{
16}
17
19{
20 SetMockTime(ConsumeTime(m_fuzzed_data_provider)); // Time could go backwards.
22}
virtual bool interrupted() const override
Return true if operator()() has been called.
virtual bool sleep_for(Clock::duration) override
Sleep for the given duration.
FuzzedThreadInterrupt(FuzzedDataProvider &fuzzed_data_provider)
FuzzedDataProvider & m_fuzzed_data_provider
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
Definition: util.cpp:34
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
Definition: time.cpp:40