Lines Matching defs:mutex
22 pthread_mutex_t mutex;
63 r = pthread_mutex_init(&mutex, NULL); assert(r == 0);
64 fprintf(stderr, "Locking mutex via pthread_mutex_trylock().\n");
65 r = pthread_mutex_trylock(&mutex); assert(r == 0);
66 r = pthread_mutex_unlock(&mutex); assert(r == 0);
67 fprintf(stderr, "Locking mutex via pthread_mutex_lock().\n");
68 r = pthread_mutex_lock(&mutex); assert(r == 0);
69 r = pthread_mutex_unlock(&mutex); assert(r == 0);
70 fprintf(stderr, "Locking mutex via pthread_mutex_timedlock().\n");
72 r = pthread_mutex_timedlock(&mutex, &abs_timeout); assert(r == 0);
73 r = pthread_mutex_unlock(&mutex); assert(r == 0);
75 r = pthread_mutex_destroy(&mutex); assert(r == 0);