tin  1.5.9
tsm::cancellation_source< MaxWaiters > Class Template Reference

#include <sync.h>

Inheritance diagram for tsm::cancellation_source< MaxWaiters >:
Inheritance graph
Collaboration diagram for tsm::cancellation_source< MaxWaiters >:
Collaboration graph

Public Member Functions

cancellation_token< MaxWaiters > token () noexcept
 
void request_cancel () noexcept
 
void reset () noexcept
 
bool stop_requested () const noexcept
 

Friends

class cancellation_token< MaxWaiters >
 

Detailed Description

template<std::size_t MaxWaiters = 4U>
class tsm::cancellation_source< MaxWaiters >

Cooperative cancellation source.

Requesting cancellation sets a sticky flag and wakes all tasks waiting on its token. The source does not interrupt a running coroutine; task code observes the token at explicit await or poll points.

Member Function Documentation

◆ request_cancel()

template<std::size_t MaxWaiters = 4U>
void tsm::cancellation_source< MaxWaiters >::request_cancel ( )
inlinenoexcept

◆ reset()

template<std::size_t MaxWaiters = 4U>
void tsm::cancellation_source< MaxWaiters >::reset ( )
inlinenoexcept

◆ stop_requested()

template<std::size_t MaxWaiters = 4U>
bool tsm::cancellation_source< MaxWaiters >::stop_requested ( ) const
inlinenoexcept

◆ token()

template<std::size_t MaxWaiters = 4U>
cancellation_token<MaxWaiters> tsm::cancellation_source< MaxWaiters >::token ( )
inlinenoexcept

Friends And Related Function Documentation

◆ cancellation_token< MaxWaiters >

template<std::size_t MaxWaiters = 4U>
friend class cancellation_token< MaxWaiters >
friend

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