Lines Matching refs:mutexes
23 * Create NUM_THREADS to walk through an array of malloc'd pthread mutexes.
34 * 2006-03-01: Changed mutexes to PTHREAD_MUTEX_ROBUST_NP type -Sripathi Kodi
53 static pthread_mutex_t *mutexes[NUM_MUTEXES];
83 pthread_mutex_unlock(mutexes[i - NUM_CONCURRENT_LOCKS]);
87 pthread_mutex_lock(mutexes[i]);
120 /* malloc and initialize the mutexes */
121 printf("allocating and initializing %d mutexes\n", NUM_MUTEXES);
123 if (!(mutexes[m] = malloc(sizeof(pthread_mutex_t)))) {
126 if ((ret = pthread_mutex_init(mutexes[m], &mutexattr))) {
130 printf("mutexes allocated and initialized successfully\n");
140 /* destroy all the mutexes */
142 if (mutexes[m]) {
143 if ((ret = pthread_mutex_destroy(mutexes[m])))
145 free(mutexes[m]);