Switch from pthread_mutex_trylock() to ...lock().