Right, Ive got a 2D array of cells mycell and each runs upon its own thread.
In this thread each cell it to have its own mutex and variable condition.
I think I am getting a segmentation fault because I have been creating each mutex by
where r and c are the row and column of the 2D array.Code:pthread_mutex_t mutex[r][c]
So the above code is simply a way of trying to index the mutex belonging to each cell's thread.
But I now think that when, for example, r = 3 and c = 2, the above code creates a 2D array of mutexes  instead of a single mutex belonging to mycell.
This is where I need some help please! My runner code for each thread is aware of the r and c values so it knows which cell it should be creating a mutex for, but I have no idea how to create a mutex that is indexed to that cell.
Any help would be greatly appreciated. Thanks.