Home | History | Annotate | Download | only in pthread_cond_wait

Lines Matching defs:mutex

9  *   shall block on a condition variable. It shall be called with mutex locked
23 pthread_mutex_t mutex;
44 if (pthread_mutex_lock(&td.mutex) != 0) {
45 fprintf(stderr, "Thread1 failed to acquire mutex\n");
52 rc = pthread_cond_wait(&td.cond, &td.mutex);
64 pthread_mutex_unlock(&td.mutex);
72 if (pthread_mutex_init(&td.mutex, NULL) != 0) {
73 fprintf(stderr, "Fail to initialize mutex\n");
88 /* acquire the mutex released by pthread_cond_wait() within thread 1 */
89 if (pthread_mutex_lock(&td.mutex) != 0) {
90 fprintf(stderr, "Main: Fail to acquire mutex\n");
93 if (pthread_mutex_unlock(&td.mutex) != 0) {
94 fprintf(stderr, "Main: Fail to release mutex\n");