VLink  2.1.0
A high-performance communication middleware
vlink::MessageLoop::AliveState Struct Referencefinal

Lifetime gate shared with cross-thread observers. More...

#include <message_loop.h>

Collaboration diagram for vlink::MessageLoop::AliveState:

Public Attributes

std::mutex mtx
 
std::atomic_bool alive {true}
 

Detailed Description

Lifetime gate shared with cross-thread observers.

The destructor of MessageLoop flips alive to false under mtx as its very first step, so a caller that holds mtx and observes alive == true is guaranteed the loop is still safe to touch. Obtain via get_alive_state.

Member Data Documentation

◆ alive

std::atomic_bool vlink::MessageLoop::AliveState::alive {true}

◆ mtx

std::mutex vlink::MessageLoop::AliveState::mtx

The documentation for this struct was generated from the following file: