Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
void WM_job_main_thread_lock_release(wmJob *wm_job)
{
	BLI_ticket_mutex_unlock(wm_job->main_thread_mutex);
}