Dovrebbe fare al caso tuo: http://stackoverflow.com/questions/2...meout-a-thread