Lines Matching defs:mut

39   ares__thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut));
40 if (mut == NULL) {
44 InitializeCriticalSection(&mut->mutex);
45 return mut;
48 void ares__thread_mutex_destroy(ares__thread_mutex_t *mut)
50 if (mut == NULL) {
53 DeleteCriticalSection(&mut->mutex);
54 ares_free(mut);
57 void ares__thread_mutex_lock(ares__thread_mutex_t *mut)
59 if (mut == NULL) {
62 EnterCriticalSection(&mut->mutex);
65 void ares__thread_mutex_unlock(ares__thread_mutex_t *mut)
67 if (mut == NULL) {
70 LeaveCriticalSection(&mut->mutex);
112 ares__thread_mutex_t *mut)
114 if (cond == NULL || mut == NULL) {
118 SleepConditionVariableCS(&cond->cond, &mut->mutex, INFINITE);
123 ares__thread_mutex_t *mut,
126 if (cond == NULL || mut == NULL) {
130 if (!SleepConditionVariableCS(&cond->cond, &mut->mutex, timeout_ms)) {
223 ares__thread_mutex_t *mut = ares_malloc_zero(sizeof(*mut));
224 if (mut == NULL) {
229 ares_free(mut);
237 if (pthread_mutex_init(&mut->mutex, &attr) != 0) {
242 return mut;
246 ares_free(mut);
250 void ares__thread_mutex_destroy(ares__thread_mutex_t *mut)
252 if (mut == NULL) {
255 pthread_mutex_destroy(&mut->mutex);
256 ares_free(mut);
259 void ares__thread_mutex_lock(ares__thread_mutex_t *mut)
261 if (mut == NULL) {
264 pthread_mutex_lock(&mut->mutex);
267 void ares__thread_mutex_unlock(ares__thread_mutex_t *mut)
269 if (mut == NULL) {
272 pthread_mutex_unlock(&mut->mutex);
315 ares__thread_mutex_t *mut)
317 if (cond == NULL || mut == NULL) {
321 pthread_cond_wait(&cond->cond, &mut->mutex);
349 ares__thread_mutex_t *mut,
354 if (cond == NULL || mut == NULL) {
360 if (pthread_cond_timedwait(&cond->cond, &mut->mutex, &ts) != 0) {
428 void ares__thread_mutex_destroy(ares__thread_mutex_t *mut)
430 (void)mut;
433 void ares__thread_mutex_lock(ares__thread_mutex_t *mut)
435 (void)mut;
438 void ares__thread_mutex_unlock(ares__thread_mutex_t *mut)
440 (void)mut;
464 ares__thread_mutex_t *mut)
467 (void)mut;
472 ares__thread_mutex_t *mut,
476 (void)mut;