Home | History | Annotate | Download | only in pthread_mutex_trylock

Lines Matching defs:mutex

20 	pthread_mutex_t mutex;
23 /* Initialize a mutex object with the default mutex attributes */
24 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) {
29 /* Try to lock the mutex using pthread_mutex_trylock() */
30 if ((rc = pthread_mutex_trylock(&mutex)) == 0) {
31 pthread_mutex_unlock(&mutex);
37 /* PATCH: since we are using the mutex properly, */
40 fprintf(stderr, "The mutex was already locked\n");
42 fprintf(stderr, "Invalid mutex object\n");