Skip to content

Commit 4e87f81

Browse files
committed
Merge branch '1.5.x'
2 parents fd478be + 71c15cb commit 4e87f81

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,23 @@ public void stop() {
182182
* @param remainingScans the number of remaining scans
183183
*/
184184
void stopAfter(int remainingScans) {
185+
Thread thread = null;
185186
synchronized (this.monitor) {
186-
Thread thread = this.watchThread;
187+
thread = this.watchThread;
187188
if (thread != null) {
188189
this.remainingScans.set(remainingScans);
189190
if (remainingScans <= 0) {
190191
thread.interrupt();
191192
}
192-
if (Thread.currentThread() != thread) {
193-
try {
194-
thread.join();
195-
}
196-
catch (InterruptedException ex) {
197-
Thread.currentThread().interrupt();
198-
}
199-
}
200-
this.watchThread = null;
193+
}
194+
this.watchThread = null;
195+
}
196+
if (Thread.currentThread() != thread) {
197+
try {
198+
thread.join();
199+
}
200+
catch (InterruptedException ex) {
201+
Thread.currentThread().interrupt();
201202
}
202203
}
203204
}

0 commit comments

Comments
 (0)