pstore2
Public Member Functions | List of all members
pstore::heartbeat::worker_thread Class Reference

#include <heartbeat.hpp>

Public Member Functions

 worker_thread (worker_thread const &)=delete
 
 worker_thread (worker_thread &&)=delete
 
worker_threadoperator= (worker_thread const &)=delete
 
worker_threadoperator= (worker_thread &&)=delete
 
void attach (heartbeat::key_type key, callback cb)
 
void detach (heartbeat::key_type key)
 
void run () noexcept
 This is the thread entry point.
 
void step () const
 Executes a single invocation of each of the attached callbacks. More...
 
void stop () noexcept
 Instructs the worker thread to exit on its next iteration. More...
 

Detailed Description

Note
This class is in the public interface to enable it to be unit tested.

Member Function Documentation

◆ step()

void pstore::heartbeat::worker_thread::step ( ) const

Executes a single invocation of each of the attached callbacks.

This is exposed for unit testing.

Note
Except for during unit tests, the mutex must be held on entry to this function.

◆ stop()

void pstore::heartbeat::worker_thread::stop ( )
noexcept

Instructs the worker thread to exit on its next iteration.

The condition variable is signalled to wait up the thread.


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