trying to get the mutex in pthreads to work