Home | History | Annotate | Download | only in pthread_cond_broadcast

Lines Matching defs:mutex

11  *   own the mutex with which it called pthread_cond_timedwait().
28 pthread_mutex_t mutex;
42 if (pthread_mutex_lock(&td.mutex) != 0) {
43 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n",
47 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n",
60 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout);
67 if (pthread_mutex_trylock(&td.mutex) == 0) {
69 "mutex again\n", (void *)self);
74 "mutex again\n", (void *)self);
77 if (pthread_mutex_unlock(&td.mutex) != 0) {
78 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n",
83 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self);
92 if (pthread_mutex_init(&td.mutex, NULL) != 0) {
93 fprintf(stderr, "Fail to initialize mutex\n");
110 if (pthread_mutex_lock(&td.mutex) != 0) {
111 fprintf(stderr, "Main: Fail to acquire mutex\n");
114 if (pthread_mutex_unlock(&td.mutex) != 0) {
115 fprintf(stderr, "Main: Fail to release mutex\n");