diff options
Diffstat (limited to 'same/src/main/java/com/orbekk')
-rw-r--r-- | same/src/main/java/com/orbekk/same/VariableUpdaterTask.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/same/src/main/java/com/orbekk/same/VariableUpdaterTask.java b/same/src/main/java/com/orbekk/same/VariableUpdaterTask.java index f696e17..fdc1493 100644 --- a/same/src/main/java/com/orbekk/same/VariableUpdaterTask.java +++ b/same/src/main/java/com/orbekk/same/VariableUpdaterTask.java @@ -36,13 +36,14 @@ public class VariableUpdaterTask<T> extends Thread } private synchronized void waitFor(AtomicBoolean v) { - if (Thread.interrupted()) { + if (Thread.currentThread().isInterrupted()) { return; } while(!v.get()) { try { wait(); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); return; } } @@ -54,7 +55,7 @@ public class VariableUpdaterTask<T> extends Thread while (true) { waitFor(isReady); waitFor(hasNewValue); - if (Thread.interrupted()) { + if (Thread.currentThread().isInterrupted()) { break; } performWork(); |