MySQL 9.0.0
Source Code Documentation
net::io_context::DeferredWork Class Reference

queued work from io_context::executor_type::dispatch()/post()/defer(). More...

Classes

class  BasicCallable
 
class  Callable
 

Public Types

using op_type = std::unique_ptr< BasicCallable >
 

Public Member Functions

size_t run_one ()
 run a deferred work item. More...
 
template<class Func , class ProtoAllocator >
void post (Func &&f, const ProtoAllocator &)
 queue work for later execution. More...
 
bool has_outstanding_work () const
 check if work is queued for later execution. More...
 

Private Attributes

std::mutex work_mtx_
 
std::list< op_typework_
 

Detailed Description

queued work from io_context::executor_type::dispatch()/post()/defer().

Member Typedef Documentation

◆ op_type

Member Function Documentation

◆ has_outstanding_work()

bool net::io_context::DeferredWork::has_outstanding_work ( ) const
inline

check if work is queued for later execution.

Return values
trueif some work is queued.

◆ post()

template<class Func , class ProtoAllocator >
void net::io_context::DeferredWork::post ( Func &&  f,
const ProtoAllocator &   
)
inline

queue work for later execution.

◆ run_one()

size_t net::io_context::DeferredWork::run_one ( )
inline

run a deferred work item.

Returns
number work items run.
Return values
0work queue was empty, nothing was run.

Member Data Documentation

◆ work_

std::list<op_type> net::io_context::DeferredWork::work_
private

◆ work_mtx_

std::mutex net::io_context::DeferredWork::work_mtx_
mutableprivate

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