Lines Matching refs: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.
34 pthread_mutex_t mutex;
37 /* Initialize a mutex attributes object */
51 /* Initialize the mutex with that attribute obj. */
52 if(pthread_mutex_init(&mutex, &mta) != 0)
54 perror("Error intializing the mutex.\n");
58 /* Unlock an already unlocked mutex. Here, an error should be returned. */
59 if(pthread_mutex_unlock(&mutex) == 0 )
61 perror("Test FAILED: Did not return error when unlocking an already unlocked mutex.\n");