On Tue, 10 Nov 2020 21:12:25 GMT, Daniel D. Daugherty <dcu...@openjdk.org> wrote:
>> src/hotspot/share/runtime/monitorDeflationThread.cpp line 85: >> >>> 83: // visible to external suspension. >>> 84: >>> 85: ThreadBlockInVM tbivm(jt); >> >> Does this have to be a JavaThread? Could it be a non-java thread since >> deflating monitors doesn't have to call any Java code? You'd have to lock >> down the Monitor list maybe, but couldn't this be a NamedThread? This isn't >> a request to change it right now. > > Ummm... we use a JavaThread because we have to stop async deflation > during safepoints so that we're not messing with Object headers during GC. > Yes, it's possible to use a non-JavaThread because this is "just software", > but I don't want to try to figure out those races... Ok, I see why it has to be a JavaThread. ------------- PR: https://git.openjdk.java.net/jdk/pull/642