Lines Matching full: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
55 static pthread_mutex_t *mutexes[NUM_MUTEXES];
85 pthread_mutex_unlock(mutexes[i - NUM_CONCURRENT_LOCKS]);
89 pthread_mutex_lock(mutexes[i]);
122 /* malloc and initialize the mutexes */
123 printf("allocating and initializing %d mutexes\n", NUM_MUTEXES);
125 if (!(mutexes[m] = malloc(sizeof(pthread_mutex_t)))) {
128 if ((ret = pthread_mutex_init(mutexes[m], &mutexattr))) {
132 printf("mutexes allocated and initialized successfully\n");
142 /* destroy all the mutexes */
144 if (mutexes[m]) {
145 if ((ret = pthread_mutex_destroy(mutexes[m])))
147 free(mutexes[m]);