Blender V5.3
blender::wmJob Struct Reference

Public Attributes

wmJob * next
wmJob * prev
wmWindow * win
void * customdata
void(*) initjob (void *)
wm_jobs_start_callback startjob
void(*) update (void *)
void(*) timer_step (void *)
void(*) free (void *)
void(*) endjob (void *)
void(*) completed (void *)
void(*) canceled (void *)
double time_step
wmTimer * wt
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 *)
ListBaseT< ThreadSlot > threads
double start_time
TicketMutex * main_thread_mutex

Detailed Description

Definition at line 68 of file wm_jobs.cc.

Member Data Documentation

◆ canceled

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

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

Definition at line 122 of file wm_jobs.cc.

Referenced by blender::wm_job_end(), and blender::WM_jobs_callbacks_ex().

◆ completed

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

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

Definition at line 117 of file wm_jobs.cc.

Referenced by blender::wm_job_end(), and blender::WM_jobs_callbacks_ex().

◆ customdata

void* blender::wmJob::customdata

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

Definition at line 75 of file wm_jobs.cc.

Referenced by blender::WM_jobs_customdata_get(), blender::WM_jobs_customdata_set(), blender::wm_jobs_kill_job(), and blender::WM_jobs_start().

◆ endjob

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

Called when job is stopped. Executed in main thread.

Definition at line 112 of file wm_jobs.cc.

Referenced by blender::wm_job_end(), and blender::WM_jobs_callbacks_ex().

◆ endnote

uint blender::wmJob::endnote

Definition at line 130 of file wm_jobs.cc.

Referenced by blender::WM_jobs_timer().

◆ flag

◆ free

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

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

Definition at line 107 of file wm_jobs.cc.

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

◆ initjob

void(*) blender::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 80 of file wm_jobs.cc.

Referenced by blender::WM_jobs_callbacks_ex(), and blender::WM_jobs_start().

◆ job_type

◆ main_thread_mutex

TicketMutex* blender::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 157 of file wm_jobs.cc.

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

◆ name

char blender::wmJob::name[128]

For display in header, identification.

Definition at line 142 of file wm_jobs.cc.

Referenced by blender::WM_jobs_get(), blender::WM_jobs_name(), and blender::wm_jobs_test_suspend_stop().

◆ next

wmJob* blender::wmJob::next

Definition at line 69 of file wm_jobs.cc.

◆ note

uint blender::wmJob::note

The notifier event timers should send.

Definition at line 130 of file wm_jobs.cc.

Referenced by blender::wm_job_update(), and blender::WM_jobs_timer().

◆ owner

◆ prev

wmJob * blender::wmJob::prev

Definition at line 69 of file wm_jobs.cc.

◆ ready

bool blender::wmJob::ready

◆ run_customdata

void* blender::wmJob::run_customdata

◆ run_free

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

Definition at line 146 of file wm_jobs.cc.

Referenced by blender::wm_jobs_kill_job(), and blender::WM_jobs_start().

◆ running

◆ start_delay_time

double blender::wmJob::start_delay_time

Only start job after specified time delay.

Definition at line 128 of file wm_jobs.cc.

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

◆ start_time

double blender::wmJob::start_time

Definition at line 151 of file wm_jobs.cc.

Referenced by blender::WM_jobs_start(), and blender::WM_jobs_starttime().

◆ startjob

wm_jobs_start_callback blender::wmJob::startjob

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

Definition at line 85 of file wm_jobs.cc.

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

◆ suspended

◆ threads

ListBaseT<ThreadSlot> blender::wmJob::threads

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

Definition at line 149 of file wm_jobs.cc.

Referenced by blender::wm_jobs_kill_job(), blender::WM_jobs_start(), blender::wm_jobs_timer(), and blender::wm_jobs_update_progress_bars().

◆ time_step

double blender::wmJob::time_step

Running jobs each have their own timer.

Definition at line 125 of file wm_jobs.cc.

Referenced by blender::WM_jobs_start(), and blender::WM_jobs_timer().

◆ timer_step

void(*) blender::wmJob::timer_step(void *)

Optional, called for each timer step while the job is running. Can be used to send messages to the running job. For example, online asset library loading uses this to get status updates from the downloader to the loading job, like that it's done downloading some files that are now ready to be processed.

Should be used for messaging to the job only, must not be used to modify the running job, like changing the timer, replacing the custom data pointer, etc.

Executed in the main thread.

Definition at line 102 of file wm_jobs.cc.

Referenced by blender::WM_jobs_timer(), and blender::wm_jobs_timer().

◆ update

void(*) blender::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 90 of file wm_jobs.cc.

Referenced by blender::wm_job_update(), and blender::WM_jobs_callbacks_ex().

◆ win

wmWindow* blender::wmJob::win

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

Definition at line 72 of file wm_jobs.cc.

Referenced by blender::wm_job_update(), blender::WM_jobs_get(), blender::wm_jobs_kill_job(), and blender::WM_jobs_start().

◆ worker_status

◆ wt

wmTimer* blender::wmJob::wt

Definition at line 126 of file wm_jobs.cc.

Referenced by blender::wm_jobs_kill_job(), and blender::WM_jobs_start().


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