is it possible to change an object attribute when its thread is interrupted?
i've got a board (cell matrix) when i click on a cell i want to interrupt one thread and change the value of one of its attributes to the clicked cell
if(!clickedCell.isSnake()) {
for(Snake snake : board.getSnakeList()) {
if(snake.isSelected()) {
snake.interrupt();
}
}
}
it is possible to catch the interrupt exception and
try{
//some code;
} catch (InterruptedException ex){
// how do i catch the cell's x and y here so that i can do something like
// snake.setFinalCell(clickedCell);
}
finally{
notifyAll();
}
thanks.
notifyAlldoesn't resume it. Java doesn't even support thread suspension.