Home | History | Annotate | Download | only in pthread_mutex_destroy

Lines Matching defs:mutex

8  * 	It shall be safe to destroy an initialized mutex that is unlocked.
16 pthread_mutex_t mutex;
22 /* Initialize mutex with the default mutex attributes */
23 if ((rc = pthread_mutex_init(&mutex, NULL)) != 0) {
24 fprintf(stderr, "Fail to initialize mutex, rc=%d\n", rc);
28 /* Lock mutex */
29 if ((rc = pthread_mutex_lock(&mutex)) != 0) {
35 if ((rc = pthread_mutex_unlock(&mutex)) != 0) {
39 /* Destroy mutex after it is unlocked */
40 if ((rc = pthread_mutex_destroy(&mutex)) != 0) {
42 "Fail to destroy mutex after being unlocked, rc=%d\n",