Probably a better way so that it can get interrupted


@Override
public void run() {
try {
while(true) {
// change some variables
...