[PR #13758] [MERGED] Call UpdatePatternLocations from a background thread #29746

Open
opened 2026-01-31 09:36:41 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13758
Author: @lhecker
Created: 8/16/2022
Status: Merged
Merged: 8/16/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/12607-workaround


📝 Commits (1)

  • 2b10393 Call UpdatePatternLocations from a background thread

📊 Changes

2 files changed (+8 additions, -7 deletions)

View changed files

📝 src/cascadia/TerminalControl/ControlCore.cpp (+7 -6)
📝 src/cascadia/TerminalControl/ControlCore.h (+1 -1)

📄 Description

We have a number of theories why #12607 is happening, one of which is that
some GPU drivers somehow rely on Win32 messages or similar which we process
on the main thread. If we then try to acquire the console lock on the main
thread, while the GPU-driver thread itself is holding that lock, we've got
ourselves a deadlock. This PR makes this less likely by running the repeat
offender UpdatePatternLocations on a background thread instead.
We have a number of other locations which acquire the console lock on the
main thread and a thorough bug fix must be done in a different way.

Validation Steps Performed

  • After pasting an URL it gets underlined on hover

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13758 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 8/16/2022 **Status:** ✅ Merged **Merged:** 8/16/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/12607-workaround` --- ### 📝 Commits (1) - [`2b10393`](https://github.com/microsoft/terminal/commit/2b1039317bd58865c92b4a873396620e53ea5118) Call UpdatePatternLocations from a background thread ### 📊 Changes **2 files changed** (+8 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+7 -6) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+1 -1) </details> ### 📄 Description We have a number of theories why #12607 is happening, one of which is that some GPU drivers somehow rely on Win32 messages or similar which we process on the main thread. If we then try to acquire the console lock on the main thread, while the GPU-driver thread itself is holding that lock, we've got ourselves a deadlock. This PR makes this less likely by running the repeat offender `UpdatePatternLocations` on a background thread instead. We have a number of other locations which acquire the console lock on the main thread and a thorough bug fix must be done in a different way. ## Validation Steps Performed * After pasting an URL it gets underlined on hover ✅ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:36:41 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29746