thread interrupt code