Blender V4.3
wmJob Struct Reference

Public Attributes

wmJobnext
 
wmJobprev
 
wmWindowwin
 
void * customdata
 
void(* initjob )(void *)
 
wm_jobs_start_callback startjob
 
void(* update )(void *)
 
void(* free )(void *)
 
void(* endjob )(void *)
 
void(* completed )(void *)
 
void(* canceled )(void *)
 
double time_step
 
wmTimerwt
 
double start_delay_time
 
uint note
 
uint endnote
 
const void * owner
 
eWM_JobFlag flag
 
bool suspended
 
bool running
 
bool ready
 
eWM_JobType job_type
 
wmJobWorkerStatus worker_status
 
char name [128]
 
void * run_customdata
 
void(* run_free )(void *)
 
ListBase threads
 
double start_time
 
TicketMutexmain_thread_mutex
 

Detailed Description

Definition at line 57 of file wm_jobs.cc.

Member Data Documentation

◆ canceled

void(* wmJob::canceled) (void *)

Called when job is stopped abnormally, i.e. when stop=true but ready=false. Executed in main thread.

Definition at line 99 of file wm_jobs.cc.

Referenced by wm_job_end(), and WM_jobs_callbacks_ex().

◆ completed

void(* wmJob::completed) (void *)

Called when job is stopped normally, i.e. by simply completing the startjob function. Executed in main thread.

Definition at line 94 of file wm_jobs.cc.

Referenced by wm_job_end(), and WM_jobs_callbacks_ex().

◆ customdata

void* wmJob::customdata

Should store entirely owned context, for start, update, free.

Definition at line 64 of file wm_jobs.cc.

Referenced by WM_jobs_customdata_get(), WM_jobs_customdata_set(), wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().

◆ endjob

void(* wmJob::endjob) (void *)

Called when job is stopped. Executed in main thread.

Definition at line 89 of file wm_jobs.cc.

Referenced by wm_job_end(), and WM_jobs_callbacks_ex().

◆ endnote

uint wmJob::endnote

Definition at line 107 of file wm_jobs.cc.

Referenced by WM_jobs_timer(), and wm_jobs_timer().

◆ flag

◆ free

void(* wmJob::free) (void *)

Free callback (typically for customdata). Executed in main thread.

Definition at line 84 of file wm_jobs.cc.

Referenced by WM_jobs_customdata_set(), wm_jobs_kill_job(), and WM_jobs_start().

◆ initjob

void(* wmJob::initjob) (void *)

To prevent cpu overhead, use this one which only gets called when job really starts. Executed in main thread.

Definition at line 69 of file wm_jobs.cc.

Referenced by WM_jobs_callbacks_ex(), and WM_jobs_start().

◆ job_type

◆ main_thread_mutex

TicketMutex* wmJob::main_thread_mutex

Ticket mutex for main thread locking while some job accesses data that the main thread might modify at the same time.

Definition at line 134 of file wm_jobs.cc.

Referenced by wm_job_free(), WM_job_main_thread_lock_acquire(), WM_job_main_thread_lock_release(), wm_job_main_thread_yield(), and WM_jobs_get().

◆ name

char wmJob::name[128]

For display in header, identification.

Definition at line 119 of file wm_jobs.cc.

Referenced by WM_jobs_get(), WM_jobs_name(), wm_jobs_test_suspend_stop(), and wm_jobs_timer().

◆ next

wmJob* wmJob::next

Definition at line 58 of file wm_jobs.cc.

◆ note

uint wmJob::note

The notifier event timers should send.

Definition at line 107 of file wm_jobs.cc.

Referenced by WM_jobs_timer(), and wm_jobs_timer().

◆ owner

◆ prev

wmJob * wmJob::prev

Definition at line 58 of file wm_jobs.cc.

◆ ready

bool wmJob::ready

Definition at line 112 of file wm_jobs.cc.

Referenced by do_job_thread(), wm_job_end(), WM_jobs_start(), and wm_jobs_timer().

◆ run_customdata

void* wmJob::run_customdata

Once running, we store this separately.

Definition at line 122 of file wm_jobs.cc.

Referenced by do_job_thread(), wm_job_end(), WM_jobs_customdata_get(), wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().

◆ run_free

void(* wmJob::run_free) (void *)

Definition at line 123 of file wm_jobs.cc.

Referenced by wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().

◆ running

◆ start_delay_time

double wmJob::start_delay_time

Only start job after specified time delay.

Definition at line 105 of file wm_jobs.cc.

Referenced by WM_jobs_delay_start(), WM_jobs_start(), and wm_jobs_test_suspend_stop().

◆ start_time

double wmJob::start_time

Definition at line 128 of file wm_jobs.cc.

Referenced by WM_jobs_start(), WM_jobs_starttime(), and wm_jobs_timer().

◆ startjob

wm_jobs_start_callback wmJob::startjob

This performs the actual parallel work. Executed in worker thread(s).

Definition at line 74 of file wm_jobs.cc.

Referenced by do_job_thread(), WM_jobs_callbacks_ex(), and WM_jobs_start().

◆ suspended

bool wmJob::suspended

Definition at line 112 of file wm_jobs.cc.

Referenced by WM_jobs_start(), wm_jobs_test_suspend_stop(), and wm_jobs_timer().

◆ threads

ListBase wmJob::threads

We use BLI_threads api, but per job only 1 thread runs.

Definition at line 126 of file wm_jobs.cc.

Referenced by wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().

◆ time_step

double wmJob::time_step

Running jobs each have their own timer.

Definition at line 102 of file wm_jobs.cc.

Referenced by WM_jobs_start(), and WM_jobs_timer().

◆ update

void(* wmJob::update) (void *)

Called if thread defines so (see do_update flag), and max once per timer step. Executed in main thread.

Definition at line 79 of file wm_jobs.cc.

Referenced by WM_jobs_callbacks_ex(), and wm_jobs_timer().

◆ win

wmWindow* wmJob::win

Job originating from, keep track of this when deleting windows.

Definition at line 61 of file wm_jobs.cc.

Referenced by WM_jobs_get(), wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().

◆ worker_status

◆ wt

wmTimer* wmJob::wt

Definition at line 103 of file wm_jobs.cc.

Referenced by wm_jobs_kill_job(), WM_jobs_start(), and wm_jobs_timer().


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