Lines Matching refs:job

19     nxt_job_t  *job;  in nxt_job_create()  local
27 job = nxt_mp_zget(mp, size); in nxt_job_create()
31 job = nxt_mp_zalloc(mp, size); in nxt_job_create()
35 if (nxt_fast_path(job != NULL)) { in nxt_job_create()
36 job->cache_size = (uint16_t) cache_size; in nxt_job_create()
37 job->mem_pool = mp; in nxt_job_create()
38 nxt_job_set_name(job, "job"); in nxt_job_create()
42 nxt_queue_self(&job->link); in nxt_job_create()
44 return job; in nxt_job_create()
49 nxt_job_init(nxt_job_t *job, size_t size) in nxt_job_init() argument
51 nxt_memzero(job, size); in nxt_job_init()
53 nxt_job_set_name(job, "job"); in nxt_job_init()
55 nxt_queue_self(&job->link); in nxt_job_init()
62 nxt_job_t *job; in nxt_job_destroy() local
64 job = data; in nxt_job_destroy()
66 nxt_queue_remove(&job->link); in nxt_job_destroy()
68 if (job->cache_size == 0) { in nxt_job_destroy()
70 if (job->mem_pool != NULL) { in nxt_job_destroy()
71 nxt_mp_destroy(job->mem_pool); in nxt_job_destroy()
75 nxt_mp_free(job->mem_pool, job); in nxt_job_destroy()
83 nxt_job_cleanup_add(nxt_mp_t *mp, nxt_job_t *job)
91 mpcl->data = job;
107 nxt_job_start(nxt_task_t *task, nxt_job_t *job, nxt_work_handler_t handler) in nxt_job_start() argument
109 nxt_debug(task, "%s start", job->name); in nxt_job_start()
111 if (job->thread_pool != NULL) { in nxt_job_start()
114 job->engine = task->thread->engine; in nxt_job_start()
116 nxt_work_set(&job->work, nxt_job_thread_trampoline, in nxt_job_start()
117 job->task, job, (void *) handler); in nxt_job_start()
119 ret = nxt_thread_pool_post(job->thread_pool, &job->work); in nxt_job_start()
125 handler = job->abort_handler; in nxt_job_start()
128 handler(job->task, job, job->data); in nxt_job_start()
137 nxt_job_t *job; in nxt_job_thread_trampoline() local
140 job = obj; in nxt_job_thread_trampoline()
143 nxt_debug(task, "%s thread", job->name); in nxt_job_thread_trampoline()
145 if (nxt_slow_path(job->cancel)) { in nxt_job_thread_trampoline()
146 nxt_job_return(task, job, job->abort_handler); in nxt_job_thread_trampoline()
149 handler(job->task, job, job->data); in nxt_job_thread_trampoline()
155 nxt_job_return(nxt_task_t *task, nxt_job_t *job, nxt_work_handler_t handler) in nxt_job_return() argument
157 nxt_debug(task, "%s return", job->name); in nxt_job_return()
159 if (job->engine != NULL) { in nxt_job_return()
162 nxt_work_set(&job->work, nxt_job_thread_return_handler, in nxt_job_return()
163 job->task, job, (void *) handler); in nxt_job_return()
165 nxt_event_engine_post(job->engine, &job->work); in nxt_job_return()
170 if (nxt_slow_path(job->cancel)) { in nxt_job_return()
171 nxt_debug(task, "%s cancellation", job->name); in nxt_job_return()
172 handler = job->abort_handler; in nxt_job_return()
176 handler, job->task, job, job->data); in nxt_job_return()
183 nxt_job_t *job; in nxt_job_thread_return_handler() local
186 job = obj; in nxt_job_thread_return_handler()
189 job->task->thread = task->thread; in nxt_job_thread_return_handler()
191 if (nxt_slow_path(job->cancel)) { in nxt_job_thread_return_handler()
192 nxt_debug(task, "%s cancellation", job->name); in nxt_job_thread_return_handler()
193 handler = job->abort_handler; in nxt_job_thread_return_handler()
196 handler(job->task, job, job->data); in nxt_job_thread_return_handler()