Try defining pthread_mutex_t