![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
Mocked CThreadInterrupt that returns "randomly" whether it is interrupted and never sleeps. More...
#include <threadinterrupt.h>
Public Member Functions | |
| FuzzedThreadInterrupt (FuzzedDataProvider &fuzzed_data_provider) | |
| virtual bool | interrupted () const override |
Return true if operator()() has been called. More... | |
| virtual bool | sleep_for (Clock::duration) override |
| Sleep for the given duration. More... | |
Public Member Functions inherited from CThreadInterrupt | |
| CThreadInterrupt () | |
| virtual | ~CThreadInterrupt ()=default |
| virtual bool | interrupted () const |
Return true if operator()() has been called. More... | |
| virtual | operator bool () const |
An alias for interrupted(). More... | |
| virtual void | operator() () EXCLUSIVE_LOCKS_REQUIRED(!mut) |
Interrupt any sleeps. After this interrupted() will return true. More... | |
| virtual void | reset () |
| Reset to an non-interrupted state. More... | |
| virtual bool | sleep_for (Clock::duration rel_time) EXCLUSIVE_LOCKS_REQUIRED(!mut) |
| Sleep for the given duration. More... | |
Private Attributes | |
| FuzzedDataProvider & | m_fuzzed_data_provider |
Additional Inherited Members | |
Public Types inherited from CThreadInterrupt | |
| using | Clock = std::chrono::steady_clock |
Mocked CThreadInterrupt that returns "randomly" whether it is interrupted and never sleeps.
Definition at line 16 of file threadinterrupt.h.
|
explicit |
Definition at line 8 of file threadinterrupt.cpp.
|
overridevirtual |
Return true if operator()() has been called.
Reimplemented from CThreadInterrupt.
Definition at line 13 of file threadinterrupt.cpp.
|
overridevirtual |
Sleep for the given duration.
| true | The time passed. |
| false | The sleep was interrupted. |
Reimplemented from CThreadInterrupt.
Definition at line 18 of file threadinterrupt.cpp.
|
private |
Definition at line 25 of file threadinterrupt.h.