Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::ThreadPoolTask Struct Reference

A small task containing a function to execute that can be queued in the thread pool. More...

#include <ThreadPool.h>

Public Attributes

Function< void()> function
 Function that will be executed during the task.
 
Function< void()> afterRelease
 Optional worker notification after an executed task node is released.
 

Friends

struct ThreadPool
 

Detailed Description

A small task containing a function to execute that can be queued in the thread pool.

Fill Task::function with any function to execute in the thread pool.

Member Data Documentation

◆ afterRelease

Function<void()> SC::ThreadPoolTask::afterRelease

Optional worker notification after an executed task node is released.

Discarded queued tasks do not notify. A copy is invoked, so it may destroy or requeue this Task. waitForTask waits for node release; waitForAllTasks/destroy also join this notification. Keep it nonblocking with respect to the pool itself: do not wait for or destroy this pool from here.

◆ function

Function<void()> SC::ThreadPoolTask::function

Function that will be executed during the task.


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