From 2642b0f04235343840cfafd9b1b63b8f2111788c Mon Sep 17 00:00:00 2001 From: Brandon Thetford Date: Wed, 21 Feb 2024 00:25:29 -0700 Subject: [PATCH] Annotate concurrency problem --- Terminal.Gui/View/Layout/ViewLayout.cs | 4 +++- Terminal.sln.DotSettings | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Terminal.Gui/View/Layout/ViewLayout.cs b/Terminal.Gui/View/Layout/ViewLayout.cs index f3945fdd1..81deead70 100644 --- a/Terminal.Gui/View/Layout/ViewLayout.cs +++ b/Terminal.Gui/View/Layout/ViewLayout.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Diagnostics; namespace Terminal.Gui; @@ -553,6 +553,8 @@ public partial class View /// The view that was found at the and coordinates. /// if no view was found. /// + // CONCURRENCY: This method is not thread-safe. + // Undefined behavior and likely program crashes are exposed by unsynchronized access to InternalSubviews. public static View? FindDeepestView (View? start, int x, int y, out int resultX, out int resultY) { resultY = resultX = 0; diff --git a/Terminal.sln.DotSettings b/Terminal.sln.DotSettings index 930a19823..621952feb 100644 --- a/Terminal.sln.DotSettings +++ b/Terminal.sln.DotSettings @@ -425,4 +425,5 @@ Concurrency Issue (?<=\W|^)(?<TAG>CONCURRENCY)(\W|$)(.*) Warning + True