Fix #4900: 修复 ManagedProcess#getLines 完成后不会解除锁定的问题 (#4913)

This commit is contained in:
Glavo
2025-12-03 16:19:17 +08:00
committed by GitHub
parent aae02bef50
commit c321453399

View File

@@ -113,7 +113,7 @@ public final class ManagedProcess {
*/
public List<String> getLines(Predicate<String> lineFilter) {
lock.lock();
try {
if (lineFilter == null)
return List.copyOf(lines);
@@ -123,6 +123,9 @@ public final class ManagedProcess {
res.add(line);
}
return Collections.unmodifiableList(res);
} finally {
lock.unlock();
}
}
public void addLine(String line) {