I need to see if a mutex is locked or unlocked in an if statement so I check it like this...
if(mutex[id] != 2){ /* do stuff */ }
but w
You can't compare a pthread_mutex_t with a int.
You can use
int pthread_mutex_trylock(pthread_mutex_t *mutex);
to check that.