void sgen_workers_enqueue_job (SgenThreadPoolJob *job, gboolean enqueue) { if (!enqueue) { job->func (NULL, job); sgen_thread_pool_job_free (job); return; } sgen_thread_pool_job_enqueue (job); }
/* Assumes that the lock is held. */ static void remove_job (SgenThreadPoolJob *job) { ssize_t index; SGEN_ASSERT (0, job->state == STATE_DONE, "Why are we removing a job that's not done?"); index = find_job_in_queue (job); SGEN_ASSERT (0, index >= 0, "Why is the job we're trying to remove not in the queue?"); job_queue.data [index] = NULL; sgen_pointer_queue_remove_nulls (&job_queue); sgen_thread_pool_job_free (job); }