I'd like to kill a thread from another thread and I'd like to do when it is running, so it won't be anything like change the loop variable to something. What would be the most appropriate way to do it?
To be more clear, I am using cURL and after some point i don't want curl to perform downloading. curl API does not provide anything like that. So I have to cancel the thread.