Bitcoin Core  31.0.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 
18 bool FuzzedThreadInterrupt::sleep_for(Clock::duration)
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.
FuzzedThreadInterrupt(FuzzedDataProvider &fuzzed_data_provider)
virtual bool sleep_for(Clock::duration) override
Sleep for the given duration.
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
Definition: util.cpp:34
FuzzedDataProvider & fuzzed_data_provider
Definition: fees.cpp:38
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
Definition: time.cpp:44
FuzzedDataProvider & m_fuzzed_data_provider