Lines Matching refs:c
30 typedef void (*signal_func)(struct worker_config* c, int* flag);
31 typedef int (*wait_func)(struct worker_config* c, const int* flag);
75 worker_config* c = arg; in worker() local
76 c->signal_cond(c, &c->posted_1); in worker()
77 c->wait_cond(c, &c->posted_2); in worker()
82 static void condvar_signal(worker_config* c, int* flag) { in condvar_signal() argument
84 uv_sem_wait(&c->sem_waiting); in condvar_signal()
87 uv_mutex_lock(&c->mutex); in condvar_signal()
93 if (c->use_broadcast) in condvar_signal()
94 uv_cond_broadcast(&c->cond); in condvar_signal()
96 uv_cond_signal(&c->cond); in condvar_signal()
98 uv_mutex_unlock(&c->mutex); in condvar_signal()
101 uv_sem_post(&c->sem_signaled); in condvar_signal()
106 static int condvar_wait(worker_config* c, const int* flag) { in condvar_wait() argument
107 uv_mutex_lock(&c->mutex); in condvar_wait()
110 uv_sem_post(&c->sem_waiting); in condvar_wait()
114 uv_cond_wait(&c->cond, &c->mutex); in condvar_wait()
118 uv_mutex_unlock(&c->mutex); in condvar_wait()
121 uv_sem_wait(&c->sem_signaled); in condvar_wait()
166 static int condvar_timedwait(worker_config* c, const int* flag) { in condvar_timedwait() argument
171 uv_mutex_lock(&c->mutex); in condvar_timedwait()
174 uv_sem_post(&c->sem_waiting); in condvar_timedwait()
178 r = uv_cond_timedwait(&c->cond, &c->mutex, (uint64_t)(1 * 1e9)); /* 1 s */ in condvar_timedwait()
183 uv_mutex_unlock(&c->mutex); in condvar_timedwait()
186 uv_sem_wait(&c->sem_signaled); in condvar_timedwait()