Skip to content

task_list

Alairion edited this page May 8, 2021 · 3 revisions

nes::task_list

Defined in header <nes/thread_pool.hpp>

class task_list;

Description

nes::task_list are opaque handles. To create an actual task list you have to use nes::task_builder.

Public Member functions

Function Description
task_list Creates a new, invalid, task list
~task_list Destroys the task list
operator= Assigns a task list

Example

main.cpp

#include <nes/thread_pool.hpp>

int main()
{
    nes::task_builder builder{};

    builder.dispatch(42, 12, 3, [](std::uint32_t x, std::uint32_t y, std::uint32_t z)
    {
        //Do something
    });

    builder.execute([]()
    {
        //Do something
    });
    
    nes::task_list list{builder.build()};
}
Clone this wiki locally