[PR #12181] Fix unbalanced unlock in PtySignalInputThread::_Shutdown #28889

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

Original Pull Request: https://github.com/microsoft/terminal/pull/12181

State: closed
Merged: Yes


The only way to notice that LeaveCriticalSection() was called more
often than EnterCriticalSection() is by calling EnterCriticalSection()
again in the future, which will then deadlock.
Since this bug occurs on exit it wasn't noticeable with the old console lock.
With the new, stricter ticket lock this bug causes a fail-fast exit.

PR Checklist

Validation Steps Performed

  • Launch and then exit Windows Terminal
  • OpenConsole cleanly exits
**Original Pull Request:** https://github.com/microsoft/terminal/pull/12181 **State:** closed **Merged:** Yes --- The only way to notice that LeaveCriticalSection() was called more often than EnterCriticalSection() is by calling EnterCriticalSection() again in the future, which will then deadlock. Since this bug occurs on exit it wasn't noticeable with the old console lock. With the new, stricter ticket lock this bug causes a fail-fast exit. ## PR Checklist * [x] Closes #12168 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Launch and then exit Windows Terminal * OpenConsole cleanly exits ✅
claunia added the pull-request label 2026-01-31 09:31:27 +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#28889