Skip to content

Commit bf49922

Browse files
FileAlternationMonitor#stop() kill himsleft instead of letting the thread running
1 parent bfd83b0 commit bf49922

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* A runnable that spawns a monitoring thread triggering any
2525
* registered {@link FileAlterationObserver} at a specified interval.
26-
*
26+
*
2727
* @see FileAlterationObserver
2828
* @version $Id$
2929
* @since 2.0
@@ -112,7 +112,7 @@ public void removeObserver(final FileAlterationObserver observer) {
112112

113113
/**
114114
* Returns the set of {@link FileAlterationObserver} registered with
115-
* this monitor.
115+
* this monitor.
116116
*
117117
* @return The set of {@link FileAlterationObserver}
118118
*/
@@ -165,8 +165,8 @@ public synchronized void stop(final long stopInterval) throws Exception {
165165
running = false;
166166
try {
167167
thread.join(stopInterval);
168+
thread.interrupt();
168169
} catch (final InterruptedException e) {
169-
Thread.currentThread().interrupt();
170170
}
171171
for (final FileAlterationObserver observer : observers) {
172172
observer.destroy();

0 commit comments

Comments
 (0)