RFR: 8351651: Cleanup LockStack::is_owning_thread

Stefan Karlsson stefank at openjdk.org
Tue Mar 11 13:01:00 UTC 2025


On Tue, 11 Mar 2025 12:15:15 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This is a minor mostly trivial change I found while reading through code looking for something else.
> Tested with tier1-4.

src/hotspot/share/runtime/lockStack.hpp line 70:

> 68: 
> 69:   // Tests if the calling thread is the thread that owns this lock-stack.
> 70:   bool is_owning_thread(JavaThread* current) const PRODUCT_RETURN;

This will not work in product builds.

Even if this is fixed, I think it is somewhat dangerous to leave this function available in product builds if it gives the wrong answer.

I'm voting for keeping this in as a product function. Or, alternatively, compile out the entire declaration in product builds. Thought, I do prefer the former since there's no obvious (to me) need to compile this out.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23981#discussion_r1989211012


More information about the hotspot-runtime-dev mailing list