Lines Matching refs:job
80 ASYNC_JOB *job = NULL; in async_job_new() local
82 job = OPENSSL_zalloc(sizeof(*job)); in async_job_new()
83 if (job == NULL) in async_job_new()
86 job->status = ASYNC_JOB_RUNNING; in async_job_new()
88 return job; in async_job_new()
91 static void async_job_free(ASYNC_JOB *job) in async_job_free() argument
93 if (job != NULL) { in async_job_free()
94 OPENSSL_free(job->funcargs); in async_job_free()
95 async_fibre_free(&job->fibrectx); in async_job_free()
96 OPENSSL_free(job); in async_job_free()
101 ASYNC_JOB *job; in async_get_pool_job() local
115 job = sk_ASYNC_JOB_pop(pool->jobs); in async_get_pool_job()
116 if (job == NULL) { in async_get_pool_job()
121 job = async_job_new(); in async_get_pool_job()
122 if (job != NULL) { in async_get_pool_job()
123 if (! async_fibre_makecontext(&job->fibrectx)) { in async_get_pool_job()
124 async_job_free(job); in async_get_pool_job()
130 return job; in async_get_pool_job()
133 static void async_release_job(ASYNC_JOB *job) { in async_release_job() argument
141 OPENSSL_free(job->funcargs); in async_release_job()
142 job->funcargs = NULL; in async_release_job()
143 sk_ASYNC_JOB_push(pool->jobs, job); in async_release_job()
148 ASYNC_JOB *job; in async_start_func() local
157 job = ctx->currjob; in async_start_func()
158 job->ret = job->func(job->funcargs); in async_start_func()
161 job->status = ASYNC_JOB_STOPPING; in async_start_func()
162 if (!async_fibre_swapcontext(&job->fibrectx, in async_start_func()
173 int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *wctx, int *ret, in ASYNC_start_job() argument
188 if (*job != NULL) in ASYNC_start_job()
189 ctx->currjob = *job; in ASYNC_start_job()
198 *job = NULL; in ASYNC_start_job()
203 *job = ctx->currjob; in ASYNC_start_job()
210 if (*job == NULL) in ASYNC_start_job()
212 ctx->currjob = *job; in ASYNC_start_job()
244 *job = NULL; in ASYNC_start_job()
282 *job = NULL; in ASYNC_start_job()
288 ASYNC_JOB *job; in ASYNC_pause_job() local
301 job = ctx->currjob; in ASYNC_pause_job()
302 job->status = ASYNC_JOB_PAUSING; in ASYNC_pause_job()
304 if (!async_fibre_swapcontext(&job->fibrectx, in ASYNC_pause_job()
310 async_wait_ctx_reset_counts(job->waitctx); in ASYNC_pause_job()
317 ASYNC_JOB *job; in async_empty_pool() local
323 job = sk_ASYNC_JOB_pop(pool->jobs); in async_empty_pool()
324 async_job_free(job); in async_empty_pool()
325 } while (job); in async_empty_pool()
379 ASYNC_JOB *job; in ASYNC_init_thread() local
380 job = async_job_new(); in ASYNC_init_thread()
381 if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { in ASYNC_init_thread()
386 async_job_free(job); in ASYNC_init_thread()
389 job->funcargs = NULL; in ASYNC_init_thread()
390 sk_ASYNC_JOB_push(pool->jobs, job); /* Cannot fail due to reserve */ in ASYNC_init_thread()
443 ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job) in ASYNC_get_wait_ctx() argument
445 return job->waitctx; in ASYNC_get_wait_ctx()