Home | History | Annotate | Download | only in pthread_cond_signal

Lines Matching defs:mutex

11  *   own the mutex with which it called pthread_cond_wait().
26 pthread_mutex_t mutex;
52 if (pthread_mutex_lock(&td.mutex) != 0) {
53 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n",
57 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n",
63 rc = pthread_cond_wait(&td.cond, &td.mutex);
69 if (pthread_mutex_trylock(&td.mutex) != 0) {
71 "[Thread 0x%p] should be able to lock the recursive mutex again\n",
77 "[Thread 0x%p] was wakened and acquired the mutex again\n",
81 if (pthread_mutex_unlock(&td.mutex) != 0) {
82 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n",
87 if (pthread_mutex_unlock(&td.mutex) != 0) {
89 "[Thread 0x%p] did not owned the mutex after the cond wait\n",
94 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self);
105 fprintf(stderr, "Fail to initialize mutex attribute\n");
109 fprintf(stderr, "Fail to set the mutex attribute\n");
113 if (pthread_mutex_init(&td.mutex, &ma) != 0) {
114 fprintf(stderr, "Fail to initialize mutex\n");