From d19bf6759c167376b7fa2ffa5b5198210bad968e Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Fri, 12 Apr 2024 17:10:31 +0100 Subject: [PATCH] Synchronize display call - In TerminalUI a display call may be called from multiple threads, while only seen to happen on windows, should be synchronized. - Backport #1039 - Fixes #1040 --- .../org/springframework/shell/component/view/TerminalUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-shell-core/src/main/java/org/springframework/shell/component/view/TerminalUI.java b/spring-shell-core/src/main/java/org/springframework/shell/component/view/TerminalUI.java index da22bdae..87e0107b 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/component/view/TerminalUI.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/component/view/TerminalUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -257,7 +257,7 @@ public class TerminalUI implements ViewService { this.nonfullScreenViewRect = nonfullScreenViewRect; } - private void display() { + private synchronized void display() { log.trace("display() start"); size.copy(terminal.getSize()); if (fullScreen) {