diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
index <HASH>..<HASH> 100644
--- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
+++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
@@ -525,12 +525,16 @@ public class Restarter {
 	public static void initialize(String[] args, boolean forceReferenceCleanup,
 			RestartInitializer initializer, boolean restartOnInitialize,
 			RestartListener... listeners) {
-		if (instance == null) {
-			synchronized (Restarter.class) {
-				instance = new Restarter(Thread.currentThread(), args,
+		Restarter localInstance = null;
+		synchronized (Restarter.class) {
+			if (instance == null) {
+				localInstance = new Restarter(Thread.currentThread(), args,
 						forceReferenceCleanup, initializer, listeners);
+				instance = localInstance;
 			}
-			instance.initialize(restartOnInitialize);
+		}
+		if (localInstance != null) {
+			localInstance.initialize(restartOnInitialize);
 		}
 	}
Fix broken locking in Restarter.initialize

Closes gh-<I>