Skip to content

[release/3.8] 修复 ManagedProcess#getLines 完成后不会解除锁定的问题#4982

Merged
Glavo merged 1 commit intoHMCL-dev:release/3.8from
Glavo:backport/3.8/4913
Dec 18, 2025
Merged

[release/3.8] 修复 ManagedProcess#getLines 完成后不会解除锁定的问题#4982
Glavo merged 1 commit intoHMCL-dev:release/3.8from
Glavo:backport/3.8/4913

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Dec 14, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical concurrency bug in the ManagedProcess#getLines method where the lock would not be released if an exception occurred during execution, potentially leading to deadlocks.

  • Wraps the method body in a try-finally block to ensure the lock is always released
  • Aligns the lock management pattern with other methods in the class (addLine, addRelatedThread, destroyRelatedThreads)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Glavo Glavo merged commit 6ef823b into HMCL-dev:release/3.8 Dec 18, 2025
8 checks passed
@Glavo Glavo deleted the backport/3.8/4913 branch December 18, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants