From 2bcd421f86138db1497b94673028f8ecf4d1f4ba Mon Sep 17 00:00:00 2001 From: Sergei Tachenov Date: Thu, 27 Mar 2025 12:19:46 +0200 Subject: [PATCH] [terminal] IJ-MR-158015 Clarify EventFlowState thread usage The initial wording was wrong: it does get called from the terminal emulator thread sometimes, on history overflow, when it's not the scrapping coroutine, but the text buffer itself that initiates buffer collection. GitOrigin-RevId: 75b99b8040bce96ce6bcb7be04d152ae1a286f80 --- .../intellij/terminal/backend/fus/BackendLatencyServiceImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/terminal/backend/src/com/intellij/terminal/backend/fus/BackendLatencyServiceImpl.kt b/plugins/terminal/backend/src/com/intellij/terminal/backend/fus/BackendLatencyServiceImpl.kt index d7075f689582..f9053c72261f 100644 --- a/plugins/terminal/backend/src/com/intellij/terminal/backend/fus/BackendLatencyServiceImpl.kt +++ b/plugins/terminal/backend/src/com/intellij/terminal/backend/fus/BackendLatencyServiceImpl.kt @@ -196,7 +196,7 @@ private class BackendOutputActivityImpl : BackendOutputActivity { /** * The part of the state that is affected by collecting the text buffer and further event processing. * - * Accessed from different threads, though never from the terminal emulator thread. + * Accessed from different threads, so must be thread-safe. */ private class EventFlowState { private val collectedRanges = ConcurrentHashMap, LongRange>()