How can I exit or stop a thread immediately?
How can I make it stop immediately when the user enters an answer? I want it to reset for every question.
Here\
You can simply call pthread_cancel on that thread to exit it. And you can send SIGSTOP/SIGCONT signal via pthread_kill to stop/restart it.
pthread_cancel
pthread_kill
But if all you want is a timer, why must you thread?