Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 97 of file task.h.

Constructor & Destructor Documentation

◆ DedicatedTaskPool()

DedicatedTaskPool::DedicatedTaskPool ( )

Definition at line 107 of file task.cpp.

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

◆ ~DedicatedTaskPool()

DedicatedTaskPool::~DedicatedTaskPool ( )

Definition at line 116 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 150 of file task.cpp.

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

◆ canceled()

bool DedicatedTaskPool::canceled ( )

Definition at line 160 of file task.cpp.

References do_cancel.

◆ clear()

void DedicatedTaskPool::clear ( )
protected

Definition at line 217 of file task.cpp.

References num_decrease(), queue, and queue_mutex.

Referenced by cancel().

◆ num_decrease()

void DedicatedTaskPool::num_decrease ( int  done)
protected

Definition at line 165 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 175 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 127 of file task.cpp.

References num_increase(), queue, queue_cond, queue_mutex, and blender::compositor::task.

◆ thread_run()

void DedicatedTaskPool::thread_run ( )
protected

Definition at line 200 of file task.cpp.

References num_decrease(), blender::compositor::task, and thread_wait_pop().

Referenced by DedicatedTaskPool().

◆ thread_wait_pop()

bool DedicatedTaskPool::thread_wait_pop ( TaskRunFunction task)
protected

Definition at line 182 of file task.cpp.

References do_exit, queue, queue_cond, queue_mutex, and blender::compositor::task.

Referenced by thread_run().

◆ wait()

void DedicatedTaskPool::wait ( )

Definition at line 142 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 126 of file task.h.

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

◆ do_exit

bool DedicatedTaskPool::do_exit
protected

Definition at line 127 of file task.h.

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

◆ num

int DedicatedTaskPool::num
protected

Definition at line 125 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 119 of file task.h.

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

◆ num_mutex

thread_mutex DedicatedTaskPool::num_mutex
protected

Definition at line 118 of file task.h.

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

◆ queue

list<TaskRunFunction> DedicatedTaskPool::queue
protected

Definition at line 121 of file task.h.

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

◆ queue_cond

thread_condition_variable DedicatedTaskPool::queue_cond
protected

Definition at line 123 of file task.h.

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

◆ queue_mutex

thread_mutex DedicatedTaskPool::queue_mutex
protected

Definition at line 122 of file task.h.

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

◆ worker_thread

thread* DedicatedTaskPool::worker_thread
protected

Definition at line 129 of file task.h.

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


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