• Home
  • Raw
  • Download

Lines Matching refs:mutex

71     opj_mutex_t* mutex = (opj_mutex_t*) opj_malloc(sizeof(opj_mutex_t));  in opj_mutex_create()  local
72 if (!mutex) { in opj_mutex_create()
75 InitializeCriticalSectionAndSpinCount(&(mutex->cs), 4000); in opj_mutex_create()
76 return mutex; in opj_mutex_create()
79 void opj_mutex_lock(opj_mutex_t* mutex) in opj_mutex_lock() argument
81 EnterCriticalSection(&(mutex->cs)); in opj_mutex_lock()
84 void opj_mutex_unlock(opj_mutex_t* mutex) in opj_mutex_unlock() argument
86 LeaveCriticalSection(&(mutex->cs)); in opj_mutex_unlock()
89 void opj_mutex_destroy(opj_mutex_t* mutex) in opj_mutex_destroy() argument
91 if (!mutex) { in opj_mutex_destroy()
94 DeleteCriticalSection(&(mutex->cs)); in opj_mutex_destroy()
95 opj_free(mutex); in opj_mutex_destroy()
153 void opj_cond_wait(opj_cond_t* cond, opj_mutex_t* mutex) in opj_cond_wait() argument
181 opj_mutex_unlock(mutex); in opj_cond_wait()
188 opj_mutex_lock(mutex); in opj_cond_wait()
310 pthread_mutex_t mutex; member
315 opj_mutex_t* mutex = (opj_mutex_t*) opj_calloc(1U, sizeof(opj_mutex_t)); in opj_mutex_create() local
316 if (mutex != NULL) { in opj_mutex_create()
317 if (pthread_mutex_init(&mutex->mutex, NULL) != 0) { in opj_mutex_create()
318 opj_free(mutex); in opj_mutex_create()
319 mutex = NULL; in opj_mutex_create()
322 return mutex; in opj_mutex_create()
325 void opj_mutex_lock(opj_mutex_t* mutex) in opj_mutex_lock() argument
327 pthread_mutex_lock(&(mutex->mutex)); in opj_mutex_lock()
330 void opj_mutex_unlock(opj_mutex_t* mutex) in opj_mutex_unlock() argument
332 pthread_mutex_unlock(&(mutex->mutex)); in opj_mutex_unlock()
335 void opj_mutex_destroy(opj_mutex_t* mutex) in opj_mutex_destroy() argument
337 if (!mutex) { in opj_mutex_destroy()
340 pthread_mutex_destroy(&(mutex->mutex)); in opj_mutex_destroy()
341 opj_free(mutex); in opj_mutex_destroy()
361 void opj_cond_wait(opj_cond_t* cond, opj_mutex_t* mutex) in opj_cond_wait() argument
363 pthread_cond_wait(&(cond->cond), &(mutex->mutex)); in opj_cond_wait()
448 void opj_mutex_lock(opj_mutex_t* mutex) in opj_mutex_lock() argument
450 (void) mutex; in opj_mutex_lock()
453 void opj_mutex_unlock(opj_mutex_t* mutex) in opj_mutex_unlock() argument
455 (void) mutex; in opj_mutex_unlock()
458 void opj_mutex_destroy(opj_mutex_t* mutex) in opj_mutex_destroy() argument
460 (void) mutex; in opj_mutex_destroy()
468 void opj_cond_wait(opj_cond_t* cond, opj_mutex_t* mutex) in opj_cond_wait() argument
471 (void) mutex; in opj_cond_wait()
583 opj_mutex_t *mutex; member
609 opj_mutex_t* mutex; member
644 tp->mutex = opj_mutex_create(); in opj_thread_pool_create()
645 if (!tp->mutex) { in opj_thread_pool_create()
706 tp->worker_threads[i].mutex = opj_mutex_create(); in opj_thread_pool_setup()
707 if (tp->worker_threads[i].mutex == NULL) { in opj_thread_pool_setup()
715 opj_mutex_destroy(tp->worker_threads[i].mutex); in opj_thread_pool_setup()
726 opj_mutex_destroy(tp->worker_threads[i].mutex); in opj_thread_pool_setup()
736 opj_mutex_lock(tp->mutex); in opj_thread_pool_setup()
738 opj_cond_wait(tp->cond, tp->mutex); in opj_thread_pool_setup()
740 opj_mutex_unlock(tp->mutex); in opj_thread_pool_setup()
765 opj_mutex_lock(tp->mutex); in opj_thread_pool_get_next_job()
777 opj_mutex_unlock(tp->mutex); in opj_thread_pool_get_next_job()
786 opj_mutex_unlock(tp->mutex); in opj_thread_pool_get_next_job()
804 opj_mutex_unlock(tp->mutex); in opj_thread_pool_get_next_job()
816 opj_mutex_lock(worker_thread->mutex); in opj_thread_pool_get_next_job()
817 opj_mutex_unlock(tp->mutex); in opj_thread_pool_get_next_job()
820 opj_cond_wait(worker_thread->cond, worker_thread->mutex); in opj_thread_pool_get_next_job()
822 opj_mutex_unlock(worker_thread->mutex); in opj_thread_pool_get_next_job()
834 if (tp->mutex == NULL) { in opj_thread_pool_submit_job()
853 opj_mutex_lock(tp->mutex); in opj_thread_pool_submit_job()
858 opj_cond_wait(tp->cond, tp->mutex); in opj_thread_pool_submit_job()
881 opj_mutex_lock(worker_thread->mutex); in opj_thread_pool_submit_job()
882 opj_mutex_unlock(tp->mutex); in opj_thread_pool_submit_job()
884 opj_mutex_unlock(worker_thread->mutex); in opj_thread_pool_submit_job()
888 opj_mutex_unlock(tp->mutex); in opj_thread_pool_submit_job()
897 if (tp->mutex == NULL) { in opj_thread_pool_wait_completion()
904 opj_mutex_lock(tp->mutex); in opj_thread_pool_wait_completion()
908 opj_cond_wait(tp->cond, tp->mutex); in opj_thread_pool_wait_completion()
911 opj_mutex_unlock(tp->mutex); in opj_thread_pool_wait_completion()
928 opj_mutex_lock(tp->mutex); in opj_thread_pool_destroy()
930 opj_mutex_unlock(tp->mutex); in opj_thread_pool_destroy()
933 opj_mutex_lock(tp->worker_threads[i].mutex); in opj_thread_pool_destroy()
935 opj_mutex_unlock(tp->worker_threads[i].mutex); in opj_thread_pool_destroy()
938 opj_mutex_destroy(tp->worker_threads[i].mutex); in opj_thread_pool_destroy()
951 opj_mutex_destroy(tp->mutex); in opj_thread_pool_destroy()