libstp
Robotics library for Botball
Loading...
Searching...
No Matches
libstp::threading::compat::jthread Class Reference

#include <jthread_compat.hpp>

Public Member Functions

 jthread () noexcept=default
template<typename F, typename... Args>
 jthread (F &&f, Args &&... args)
 ~jthread ()
 jthread (const jthread &)=delete
jthread & operator= (const jthread &)=delete
 jthread (jthread &&other) noexcept
jthread & operator= (jthread &&other) noexcept
bool joinable () const noexcept
void join ()
void detach ()
stop_source get_stop_source () const noexcept
stop_token get_stop_token () const noexcept
bool request_stop () noexcept

Detailed Description

Drop-in replacement for std::jthread: owns a std::thread plus a stop_source, requests stop and joins on destruction.

Definition at line 90 of file jthread_compat.hpp.

Constructor & Destructor Documentation

◆ jthread() [1/4]

libstp::threading::compat::jthread::jthread ( )
defaultnoexcept

◆ jthread() [2/4]

template<typename F, typename... Args>
libstp::threading::compat::jthread::jthread ( F && f,
Args &&... args )
inlineexplicit

Definition at line 96 of file jthread_compat.hpp.

◆ ~jthread()

libstp::threading::compat::jthread::~jthread ( )
inline

Definition at line 113 of file jthread_compat.hpp.

◆ jthread() [3/4]

libstp::threading::compat::jthread::jthread ( const jthread & )
delete

◆ jthread() [4/4]

libstp::threading::compat::jthread::jthread ( jthread && other)
inlinenoexcept

Definition at line 125 of file jthread_compat.hpp.

Member Function Documentation

◆ detach()

void libstp::threading::compat::jthread::detach ( )
inline

Definition at line 147 of file jthread_compat.hpp.

◆ get_stop_source()

stop_source libstp::threading::compat::jthread::get_stop_source ( ) const
inlinenodiscardnoexcept

Definition at line 149 of file jthread_compat.hpp.

◆ get_stop_token()

stop_token libstp::threading::compat::jthread::get_stop_token ( ) const
inlinenodiscardnoexcept

Definition at line 150 of file jthread_compat.hpp.

◆ join()

void libstp::threading::compat::jthread::join ( )
inline

Definition at line 146 of file jthread_compat.hpp.

◆ joinable()

bool libstp::threading::compat::jthread::joinable ( ) const
inlinenodiscardnoexcept

Definition at line 145 of file jthread_compat.hpp.

◆ operator=() [1/2]

jthread & libstp::threading::compat::jthread::operator= ( const jthread & )
delete

◆ operator=() [2/2]

jthread & libstp::threading::compat::jthread::operator= ( jthread && other)
inlinenoexcept

Definition at line 130 of file jthread_compat.hpp.

◆ request_stop()

bool libstp::threading::compat::jthread::request_stop ( )
inlinenoexcept

Definition at line 154 of file jthread_compat.hpp.


The documentation for this class was generated from the following file:
  • /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-threading/include/threading/jthread_compat.hpp