Blender V4.5
TaskPool Class Reference

#include <task.h>

Classes

struct  Summary
 

Public Member Functions

 TaskPool (const TaskPoolType type, const eTaskPriority priority, void *userdata)
 
 ~TaskPool ()
 
 TaskPool (TaskPool &&other)=delete
 
 TaskPool (const TaskPool &other)=delete
 
TaskPooloperator= (const TaskPool &other)=delete
 
TaskPooloperator= (TaskPool &&other)=delete
 
void task_push (TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
 
void work_and_wait ()
 
void cancel ()
 
bool current_canceled ()
 
 TaskPool ()
 
 ~TaskPool ()
 
void push (TaskRunFunction &&task)
 
void wait_work (Summary *stats=nullptr)
 
void cancel ()
 

Static Public Member Functions

static bool canceled ()
 

Public Attributes

TaskPoolType type
 
bool use_threads
 
void * userdata
 
volatile bool is_suspended = false
 
blender::Vector< Tasksuspended_tasks
 
ListBase background_threads
 
ThreadQueuebackground_queue
 
volatile bool background_is_canceling = false
 

Protected Attributes

tbb::task_group tbb_group
 
double start_time
 
int num_tasks_pushed
 

Detailed Description

Definition at line 157 of file task_pool.cc.

Constructor & Destructor Documentation

◆ TaskPool() [1/4]

◆ ~TaskPool() [1/2]

◆ TaskPool() [2/4]

TaskPool::TaskPool ( TaskPool && other)
delete

◆ TaskPool() [3/4]

TaskPool::TaskPool ( const TaskPool & other)
delete

◆ TaskPool() [4/4]

CCL_NAMESPACE_BEGIN TaskPool::TaskPool ( )

Definition at line 14 of file task.cpp.

◆ ~TaskPool() [2/2]

TaskPool::~TaskPool ( )

Member Function Documentation

◆ cancel() [1/2]

void TaskPool::cancel ( )

◆ cancel() [2/2]

void TaskPool::cancel ( )
inline

Cancel all tasks, keep worker threads running.

Definition at line 290 of file task_pool.cc.

References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.

Referenced by BLI_task_pool_cancel().

◆ canceled()

bool TaskPool::canceled ( )
static

Definition at line 48 of file task.cpp.

◆ current_canceled()

bool TaskPool::current_canceled ( )
inline

◆ operator=() [1/2]

TaskPool & TaskPool::operator= ( const TaskPool & other)
delete

◆ operator=() [2/2]

TaskPool & TaskPool::operator= ( TaskPool && other)
delete

◆ push()

◆ task_push()

void TaskPool::task_push ( TaskRunFunction run,
void * taskdata,
bool free_taskdata,
TaskFreeFunction freedata )
inline

Create and add a new task to the pool.

Definition at line 251 of file task_pool.cc.

References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.

Referenced by BLI_task_pool_push().

◆ wait_work()

◆ work_and_wait()

void TaskPool::work_and_wait ( )
inline

Work and wait until all tasks are done.

Definition at line 272 of file task_pool.cc.

References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.

Referenced by BLI_task_pool_work_and_wait().

Member Data Documentation

◆ background_is_canceling

volatile bool TaskPool::background_is_canceling = false

Definition at line 173 of file task_pool.cc.

◆ background_queue

ThreadQueue* TaskPool::background_queue

Definition at line 172 of file task_pool.cc.

◆ background_threads

ListBase TaskPool::background_threads

Definition at line 171 of file task_pool.cc.

◆ is_suspended

volatile bool TaskPool::is_suspended = false

Definition at line 167 of file task_pool.cc.

◆ num_tasks_pushed

int TaskPool::num_tasks_pushed
protected

Definition at line 62 of file task.h.

Referenced by push(), and wait_work().

◆ start_time

double TaskPool::start_time
protected

Definition at line 59 of file task.h.

Referenced by wait_work().

◆ suspended_tasks

blender::Vector<Task> TaskPool::suspended_tasks

Definition at line 168 of file task_pool.cc.

◆ tbb_group

tbb::task_group TaskPool::tbb_group
protected

Definition at line 54 of file task.h.

Referenced by push(), and wait_work().

◆ type

TaskPoolType TaskPool::type

Definition at line 158 of file task_pool.cc.

Referenced by TaskPool(), and ~TaskPool().

◆ use_threads

bool TaskPool::use_threads

Definition at line 159 of file task_pool.cc.

Referenced by TaskPool().

◆ userdata

void* TaskPool::userdata

Definition at line 161 of file task_pool.cc.

Referenced by BLI_task_pool_user_data().


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