RFR: 8282475: SafeFetch should not rely on existence of Thread::current [v6]

Anton Kozlov akozlov at openjdk.java.net
Thu Mar 10 07:42:39 UTC 2022


On Thu, 10 Mar 2022 07:09:27 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

> > Interesting. But I would nonetheless create an assertion that checks that there is no nesting in the case without a Thread object. I would this using a thread local nesting counter in the ThreadWXEnable class (incremented in the constructor and decremented in the destructor).
> 
> Hmm, yes. And the assert would need to check the native thread still don't have a Thread object, i.e. the either Thread or TLS is used for tracking. This looks rather complicated, I agree.

Is it possible to change SafeFetch only? Switch to WXExec before calling the stub and switch WXWrite back unconditionally? We won't need to provide assert in ThreadWXEnable. But SafeFetch can check the assumption with assert via Thread, if it exists.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7727


More information about the serviceability-dev mailing list