static void wm_job_main_thread_yield(wmJob *wm_job) { /* unlock and lock the ticket mutex. because it's a fair mutex any job that * is waiting to acquire the lock will get it first, before we can lock */ BLI_ticket_mutex_unlock(wm_job->main_thread_mutex); BLI_ticket_mutex_lock(wm_job->main_thread_mutex); }
static void wm_job_free(wmWindowManager *wm, wmJob *wm_job) { BLI_remlink(&wm->jobs, wm_job); BLI_ticket_mutex_unlock(wm_job->main_thread_mutex); BLI_ticket_mutex_free(wm_job->main_thread_mutex); MEM_freeN(wm_job); }
void WM_job_main_thread_lock_acquire(wmJob *wm_job) { BLI_ticket_mutex_lock(wm_job->main_thread_mutex); /* if BLI_end_threads is being called to stop the job before it's finished, * we no longer need to lock to get access to the main thread as it's * waiting and can't respond */ if (wm_job->main_thread_mutex_ending) BLI_ticket_mutex_unlock(wm_job->main_thread_mutex); }
void WM_job_main_thread_lock_release(wmJob *wm_job) { BLI_ticket_mutex_unlock(wm_job->main_thread_mutex); }