Blender V4.3
DedicatedTaskPool Class Reference

#include <task.h>

Public Member Functions

 DedicatedTaskPool ()
 
 ~DedicatedTaskPool ()
 
void push (TaskRunFunction &&run, bool front=false)
 
void wait ()
 
void cancel ()
 
bool canceled ()
 

Protected Member Functions

void num_decrease (int done)
 
void num_increase ()
 
void thread_run ()
 
bool thread_wait_pop (TaskRunFunction &task)
 
void clear ()
 

Protected Attributes

thread_mutex num_mutex
 
thread_condition_variable num_cond
 
list< TaskRunFunctionqueue
 
thread_mutex queue_mutex
 
thread_condition_variable queue_cond
 
int num
 
bool do_cancel
 
bool do_exit
 
threadworker_thread
 

Detailed Description

Definition at line 99 of file task.h.

Constructor & Destructor Documentation

◆ DedicatedTaskPool()

DedicatedTaskPool::DedicatedTaskPool ( )

Definition at line 106 of file task.cpp.

References do_cancel, do_exit, function_bind, num, thread_run(), and worker_thread.

◆ ~DedicatedTaskPool()

DedicatedTaskPool::~DedicatedTaskPool ( )

Definition at line 115 of file task.cpp.

References do_exit, thread::join(), queue_cond, wait(), and worker_thread.

Member Function Documentation

◆ cancel()

void DedicatedTaskPool::cancel ( )

Definition at line 152 of file task.cpp.

References clear(), do_cancel, and wait().

◆ canceled()

bool DedicatedTaskPool::canceled ( )

Definition at line 162 of file task.cpp.

References do_cancel.

◆ clear()

void DedicatedTaskPool::clear ( )
protected

Definition at line 221 of file task.cpp.

References num_decrease(), and queue_mutex.

Referenced by cancel().

◆ num_decrease()

void DedicatedTaskPool::num_decrease ( int done)
protected

Definition at line 167 of file task.cpp.

References num, num_cond, and num_mutex.

Referenced by clear(), and thread_run().

◆ num_increase()

void DedicatedTaskPool::num_increase ( )
protected

Definition at line 178 of file task.cpp.

References num, num_cond, and num_mutex.

Referenced by push().

◆ push()

void DedicatedTaskPool::push ( TaskRunFunction && run,
bool front = false )

Definition at line 126 of file task.cpp.

References num_increase(), queue_cond, and queue_mutex.

◆ thread_run()

void DedicatedTaskPool::thread_run ( )
protected

Definition at line 204 of file task.cpp.

References num_decrease(), and thread_wait_pop().

Referenced by DedicatedTaskPool().

◆ thread_wait_pop()

bool DedicatedTaskPool::thread_wait_pop ( TaskRunFunction & task)
protected

Definition at line 185 of file task.cpp.

References do_exit, queue_cond, and queue_mutex.

Referenced by thread_run().

◆ wait()

void DedicatedTaskPool::wait ( )

Definition at line 143 of file task.cpp.

References num, num_cond, and num_mutex.

Referenced by cancel(), and ~DedicatedTaskPool().

Member Data Documentation

◆ do_cancel

bool DedicatedTaskPool::do_cancel
protected

Definition at line 128 of file task.h.

Referenced by cancel(), canceled(), and DedicatedTaskPool().

◆ do_exit

bool DedicatedTaskPool::do_exit
protected

Definition at line 129 of file task.h.

Referenced by DedicatedTaskPool(), thread_wait_pop(), and ~DedicatedTaskPool().

◆ num

int DedicatedTaskPool::num
protected

Definition at line 127 of file task.h.

Referenced by DedicatedTaskPool(), num_decrease(), num_increase(), and wait().

◆ num_cond

thread_condition_variable DedicatedTaskPool::num_cond
protected

Definition at line 121 of file task.h.

Referenced by num_decrease(), num_increase(), and wait().

◆ num_mutex

thread_mutex DedicatedTaskPool::num_mutex
protected

Definition at line 120 of file task.h.

Referenced by num_decrease(), num_increase(), and wait().

◆ queue

list<TaskRunFunction> DedicatedTaskPool::queue
protected

Definition at line 123 of file task.h.

◆ queue_cond

thread_condition_variable DedicatedTaskPool::queue_cond
protected

Definition at line 125 of file task.h.

Referenced by push(), thread_wait_pop(), and ~DedicatedTaskPool().

◆ queue_mutex

thread_mutex DedicatedTaskPool::queue_mutex
protected

Definition at line 124 of file task.h.

Referenced by clear(), push(), and thread_wait_pop().

◆ worker_thread

thread* DedicatedTaskPool::worker_thread
protected

Definition at line 131 of file task.h.

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


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