Home | History | Annotate | Download | only in pthread_cond_timedwait

Lines Matching defs:mutex

29 	pthread_mutex_t mutex;
45 /* Lock the mutex */
46 if (pthread_mutex_lock(&td.mutex) != 0) {
47 fprintf(stderr, "Thread1 failed to acquire the mutex\n");
62 /* Thread will now release the mutex and wait on the condition variable */
66 rc = pthread_cond_timedwait(&td.cond, &td.mutex, &timeout);
83 if (pthread_mutex_init(&td.mutex, NULL) != 0) {
84 fprintf(stderr, "Fail to initialize mutex\n");
100 /* acquire the mutex released by pthread_cond_wait() within thread 1 */
101 if (pthread_mutex_lock(&td.mutex) != 0) {
102 fprintf(stderr, "Main failed to acquire mutex\n");
105 if (pthread_mutex_unlock(&td.mutex) != 0) {
106 fprintf(stderr, "Main failed to release mutex\n");