Home | History | Annotate | Download | only in pthread_cond_signal

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",
61 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout);
68 if (pthread_mutex_trylock(&td.mutex) != 0) {
70 "[Thread 0x%p] should be able to lock the recursive mutex again\n",
76 "[Thread 0x%p] was wakened and acquired the mutex again\n",
80 if (pthread_mutex_unlock(&td.mutex) != 0) {
81 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n",
86 if (pthread_mutex_unlock(&td.mutex) != 0) {
88 "[Thread 0x%p] did not owned the mutex after the cond wait\n",
93 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self);
104 fprintf(stderr, "Fail to initialize mutex attribute\n");
108 fprintf(stderr, "Fail to set the mutex attribute\n");
112 if (pthread_mutex_init(&td.mutex, &ma) != 0) {
113 fprintf(stderr, "Fail to initialize mutex\n");