On Fri, 10 Jun 2022 06:45:00 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/misc/Signal.java line 180: >> >>> 178: if (newH == 2) { >>> 179: handlers.put(sig, handler); >>> 180: } >> >> If you made this change instead: >> >> Suggestion: >> >> Signal.Handler oldHandler; >> if (newH == 2) { >> oldHandler = handlers.put(sig, handler); >> } else { >> oldHandler = handlers.remove(sig); >> } >> >> >> Wouldn't you be able to remove the entire `synchronized` block? > > Hello David, I suspect you mean `handlers.put(sig, handler)` and not > `handlers.replace(...)`? And yes, I think what you suggest will help remove > the synchronized block here. Oops, yes you are correct! ------------- PR: https://git.openjdk.org/jdk/pull/9100