2

Using pthreads, how would one, in C, initialize array of mutexes?

For a single mutex, it seems I can use PTHREAD_MUTEX_INITIALIZER. But what about an array of them? As, in for example,

#include <pthread.h>

/*initialize mutex array*/
pthread_mutex_t mutexes[] = ...?

is there a way to make the mutex array dynamic?

And what is the difference between static and non-static mutexes?

Hyunmin Jung
  • 45
  • 1
  • 6

0 Answers0