Home | History | Annotate | Download | only in pthread_mutexattr_settype

Lines Matching defs:mutex

12   Provides errorchecking.  A thread attempting to relock this mutex without unlocking it
13 first will return with an error. A thread attempting to unlock a mutex which another
15 mutex will return with an error.
20 * 3. Create a mutex with that mutexattr object.
21 * 4. Attempt to unlock an unlocked mutex. It should return an error.
34 pthread_mutex_t mutex;
37 /* Initialize a mutex attributes object */
49 /* Initialize the mutex with that attribute obj. */
50 if (pthread_mutex_init(&mutex, &mta) != 0) {
51 perror("Error intializing the mutex.\n");
55 if (pthread_mutex_lock(&mutex) != 0) {
60 if (pthread_mutex_unlock(&mutex) != 0) {
65 /* Unlock an already unlocked mutex. Here, an error should be returned. */
66 if (pthread_mutex_unlock(&mutex) == 0) {
68 ("Test FAILED: Did not return error when unlocking an already unlocked mutex.\n");
72 if (pthread_mutex_destroy(&mutex)) {