fix: windows stopGracefully synchronization
@@ -151,6 +151,9 @@ public class WindowsExec extends Exec {
if (!process.isAlive()) {
return;
}
+
+ boolean sentConsoleCtrlEvent = false;
+ synchronized (Kernel32.INSTANCE) {
// First, start a separate process that holds the console alive
// so that later gg can re-attach to this same console
Process holderProc;
@@ -166,9 +169,6 @@ public class WindowsExec extends Exec {
return;
}
- boolean sentConsoleCtrlEvent = false;
- synchronized (Kernel32.INSTANCE) {
-
Kernel32 k32 = Kernel32.INSTANCE;
try {
// Must detach from current console before attaching to another
