On Tue, 22 Nov 2022 16:26:30 GMT, Weijun Wang <wei...@openjdk.org> wrote:

> With the introduction of Virtual Threads, the current subject is no longer 
> guaranteed to be inherited in a new thread. Remove this requirement until we 
> find another way to implement `Subject::current`.

Just re-reading the javadoc for Subject.callAs. It doesn't say anything about 
inheritance so there shouldn't be any expectation that Subject is inherited, so 
I think the change proposed here is okay. For another PR but I think the callAs 
javadoc could say a bit more about the Subject being set for the bounded 
execution of the given task. When the task completes, the current Subject is 
null or reverts to its previous value in the current thread.

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

PR: https://git.openjdk.org/jdk/pull/11292

Reply via email to