Remove the call to pthread_kill(). It doesn't make much sense.