[PR #13309] [MERGED] Fix a deadlock in ShowWindow #29470

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13309
Author: @zadjii-msft
Created: 6/15/2022
Status: Merged
Merged: 6/16/2022
Merged by: @undefined

Base: mainHead: dev/migrie/b/13301-showwindow-deadlock


📝 Commits (3)

  • 78fe75b This fixes the deadlock
  • bdac5b2 Has Anyone Really Been Far Even as Decided to Use Even Go Want to do Look More Like?
  • dc7789d til there's an async version

📊 Changes

1 file changed (+8 additions, -1 deletions)

View changed files

📝 src/host/outputStream.cpp (+8 -1)

📄 Description

When we send this ShowWindow message, if we send it to it's
going to need to get processed by the window message thread before
returning. We're handling this message under lock. However, the first
thing the conhost message thread does is lock the console. That'll
deadlock us. So unlock here, first, to let the message thread deal with
this message, then re-lock so later on this thread can unlock again
safely.


🔄 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/13309 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 6/15/2022 **Status:** ✅ Merged **Merged:** 6/16/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/13301-showwindow-deadlock` --- ### 📝 Commits (3) - [`78fe75b`](https://github.com/microsoft/terminal/commit/78fe75b5620d5602716faea6895a3183a7259f84) This fixes the deadlock - [`bdac5b2`](https://github.com/microsoft/terminal/commit/bdac5b2ac28e5afc1812dda4d8e223a40433f59b) Has Anyone Really Been Far Even as Decided to Use Even Go Want to do Look More Like? - [`dc7789d`](https://github.com/microsoft/terminal/commit/dc7789d06f3b4df2ba184abdeace50aa34d83688) til there's an async version ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/host/outputStream.cpp` (+8 -1) </details> ### 📄 Description When we send this ShowWindow message, if we send it to it's going to need to get processed by the window message thread before returning. We're handling this message under lock. However, the first thing the conhost message thread does is lock the console. That'll deadlock us. So unlock here, first, to let the message thread deal with this message, then re-lock so later on this thread can unlock again safely. * [x] Closes #13301 * [x] Tested conhost * [x] Tested terminal --- <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:35:07 +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#29470