On Thu, 30 Mar 2023 14:30:28 GMT, Roman Kennke <rken...@openjdk.org> wrote:

>> Please explain why you think this is "not safe". Yes, you can observe state 
>> that is in
>> the process of changing, but do you think that we'll see a crash with 
>> allowing
>> `Threads::owning_thread_from_object()` to be called from a non-safepoint 
>> place?
>
> I don't think we'd see a crash, but we might get false results when we are 
> scanning the lock-stack of a foreign thread, when that thread does not hold 
> still. I'm not even comfortable doing that cross-stack lock query with the 
> old code.

Given the owner could release the monitor the moment after we check I don't see 
how false results are an issue here. The existing code should be safe when not 
executed at a safepoint..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1156792723

Reply via email to