Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
util::SignalInterrupt Class Reference

Helper class that manages an interrupt flag, and allows a thread or signal to interrupt another thread. More...

#include <signalinterrupt.h>

Collaboration diagram for util::SignalInterrupt:
[legend]

Public Member Functions

 SignalInterrupt ()
 
 operator bool () const
 
bool operator() ()
 
bool reset ()
 
bool wait ()
 

Private Attributes

std::atomic< bool > m_flag
 
TokenPipeEnd m_pipe_r
 
TokenPipeEnd m_pipe_w
 

Detailed Description

Helper class that manages an interrupt flag, and allows a thread or signal to interrupt another thread.

This class is safe to be used in a signal handler. If sending an interrupt from a signal handler is not necessary, the more lightweight CThreadInterrupt class can be used instead.

Definition at line 28 of file signalinterrupt.h.

Constructor & Destructor Documentation

◆ SignalInterrupt()

util::SignalInterrupt::SignalInterrupt ( )

Definition at line 18 of file signalinterrupt.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ operator bool()

util::SignalInterrupt::operator bool ( ) const
explicit

Definition at line 28 of file signalinterrupt.cpp.

◆ operator()()

bool util::SignalInterrupt::operator() ( )

Definition at line 42 of file signalinterrupt.cpp.

Here is the call graph for this function:

◆ reset()

bool util::SignalInterrupt::reset ( )

Definition at line 33 of file signalinterrupt.cpp.

Here is the call graph for this function:

◆ wait()

bool util::SignalInterrupt::wait ( )

Definition at line 63 of file signalinterrupt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_flag

std::atomic<bool> util::SignalInterrupt::m_flag
private

Definition at line 38 of file signalinterrupt.h.

◆ m_pipe_r

TokenPipeEnd util::SignalInterrupt::m_pipe_r
private

Definition at line 42 of file signalinterrupt.h.

◆ m_pipe_w

TokenPipeEnd util::SignalInterrupt::m_pipe_w
private

Definition at line 43 of file signalinterrupt.h.


The documentation for this class was generated from the following files: