Use pthread_equal for thread comparison