Home | History | Annotate | Download | only in pthread_cond_signal

Lines Matching defs:mutex

25 	pthread_mutex_t mutex;
51 if (pthread_mutex_lock(&td.mutex) != 0) {
52 fprintf(stderr, "[Thread 0x%p] failed to acquire the mutex\n",
57 fprintf(stderr, "[Thread 0x%p] started and locked the mutex\n",
62 rc = pthread_cond_wait(&td.cond, &td.mutex);
69 "[Thread 0x%p] was wakened and acquired the mutex again\n",
72 if (pthread_mutex_unlock(&td.mutex) != 0) {
73 fprintf(stderr, "[Thread 0x%p] failed to release the mutex\n",
77 fprintf(stderr, "[Thread 0x%p] released the mutex\n", (void *)self);
86 if (pthread_mutex_init(&td.mutex, NULL) != 0) {
87 fprintf(stderr, "Fail to initialize mutex\n");
104 /* Acquire the mutex to make sure that all waiters are currently
106 if (pthread_mutex_lock(&td.mutex) != 0) {
107 fprintf(stderr, "Main: Fail to acquire mutex\n");
110 if (pthread_mutex_unlock(&td.mutex) != 0) {
111 fprintf(stderr, "Main: Fail to release mutex\n");