Blender  V3.3
Public Attributes | List of all members
wmJob Struct Reference

Public Attributes

struct wmJobnext
 
struct wmJobprev
 
wmWindowwin
 
voidcustomdata
 
void(* initjob )(void *)
 
wm_jobs_start_callback startjob
 
void(* update )(void *)
 
void(* free )(void *)
 
void(* endjob )(void *)
 
void(* completed )(void *)
 
void(* canceled )(void *)
 
double timestep
 
wmTimerwt
 
double start_delay_time
 
unsigned int note
 
unsigned int endnote
 
const voidowner
 
int flag
 
short suspended
 
short running
 
short ready
 
short do_update
 
short stop
 
short job_type
 
float progress
 
char name [128]
 
voidrun_customdata
 
void(* run_free )(void *)
 
ListBase threads
 
double start_time
 
TicketMutexmain_thread_mutex
 

Detailed Description

Definition at line 57 of file wm_jobs.c.

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.c.

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.c.

Referenced by wm_job_end(), and WM_jobs_callbacks_ex().

◆ customdata

void* wmJob::customdata

Should store entire own context, for start, update, free

Definition at line 64 of file wm_jobs.c.

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

◆ do_update

short wmJob::do_update

Definition at line 112 of file wm_jobs.c.

Referenced by do_job_thread(), 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.c.

Referenced by wm_job_end(), WM_jobs_callbacks(), and WM_jobs_callbacks_ex().

◆ endnote

unsigned int wmJob::endnote

Definition at line 107 of file wm_jobs.c.

Referenced by WM_jobs_timer(), and wm_jobs_timer().

◆ flag

int wmJob::flag

◆ free

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

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

Definition at line 84 of file wm_jobs.c.

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.c.

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

◆ job_type

short wmJob::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 129 of file wm_jobs.c.

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 116 of file wm_jobs.c.

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

◆ next

struct wmJob* wmJob::next

Definition at line 58 of file wm_jobs.c.

◆ note

unsigned int wmJob::note

The notifier event timers should send

Definition at line 107 of file wm_jobs.c.

Referenced by WM_jobs_timer(), and wm_jobs_timer().

◆ owner

const void* wmJob::owner

◆ prev

struct wmJob * wmJob::prev

Definition at line 58 of file wm_jobs.c.

◆ progress

float wmJob::progress

◆ ready

short wmJob::ready

Definition at line 112 of file wm_jobs.c.

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 119 of file wm_jobs.c.

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 120 of file wm_jobs.c.

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

◆ running

short wmJob::running

◆ start_delay_time

double wmJob::start_delay_time

Only start job after specified time delay

Definition at line 105 of file wm_jobs.c.

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

◆ start_time

double wmJob::start_time

Definition at line 125 of file wm_jobs.c.

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.c.

Referenced by do_job_thread(), WM_jobs_callbacks(), WM_jobs_callbacks_ex(), WM_jobs_kill(), WM_jobs_start(), WM_jobs_stop(), and wm_jobs_test_suspend_stop().

◆ stop

short wmJob::stop

◆ suspended

short wmJob::suspended

Definition at line 112 of file wm_jobs.c.

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 123 of file wm_jobs.c.

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

◆ timestep

double wmJob::timestep

Running jobs each have own timer

Definition at line 102 of file wm_jobs.c.

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.c.

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.c.

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

◆ wt

wmTimer* wmJob::wt

Definition at line 103 of file wm_jobs.c.

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


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