How do I interrupt a thread?

Is there a way for me to interrupt a thread, like hardware interrupts? On interrupt I want it to do something and then go back to doing whatever it was doing.