On Thu, 10 Mar 2022 07:09:27 GMT, Anton Kozlov <akoz...@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

Reply via email to