Skip to main content

class thread_queue

Declaration

class thread_queue { /* full declaration omitted */ };

Description

A single-thread job queue accepting functors and returning events that conditionally forward job results.

Declared at: include/thread_queue.h:24

Member Variables

std::unique_ptr<impl> m_impl

Member Function Overview

Member Functions

thread_queue& operator=(const thread_queue&)

Declared at: include/thread_queue.h:36

Parameters

const thread_queue&

thread_queue& operator=(thread_queue&&)

Declared at: include/thread_queue.h:37

Parameters

thread_queue&&

template <typename Fn>
async_event submit(Fn&& fn)

Description

Submit a job to the thread queue. fn must take no arguments and return either void or a type convertible to void *, which will be forwarded as the result into the event.

Declared at: include/thread_queue.h:50

Template Parameters

Fn

Parameters

Fn&& fn

thread_queue()

Description

Constructs a null thread queue that cannot receive jobs.

Declared at: include/thread_queue.h:27


explicit thread_queue(
    named_threads::thread_type t_type,
    bool enable_profiling = false)

Description

Spawns a new thread queue with the given thread name. If enable_profiling is set to true, completed events from this thread queue will report a non-nullopt duration.

Declared at: include/thread_queue.h:31

Parameters

named_threads::thread_type t_type
bool enable_profiling = false

thread_queue(const thread_queue&)

Declared at: include/thread_queue.h:34

Parameters

const thread_queue&

thread_queue(thread_queue&&)

Declared at: include/thread_queue.h:35

Parameters

thread_queue&&

~thread_queue()

Description

Destruction will await all submitted and pending jobs.

Declared at: include/thread_queue.h:40