RFR: 8263896: Remove not_suspended parameter from ObjectMonitor::exit() [v2]
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Wed Mar 24 01:47:57 UTC 2021
> Hi,
>
> Please review the following small patch. The boolean parameter not_suspended is used to detect if we need to set the current JavaThread exiting the monitor as the previous owner (_previous_owner_tid). If not_suspended is true then we set _previous_owner_tid, otherwise we skip the write (modulo the JFR checks). This parameter is always true except when we call exit() from inside enter(). This happens when the JavaThread acquires the monitor but notices that it was suspended while being in the _thread_blocked state. Since in that case the JT was never really "the owner" we skip setting _previous_owner_tid.
>
> This behaviour of releasing the monitor is just an implementation detail of ObjectMonitor::enter() which doesn't need to be exposed in the exit() API. We can identify the same scenario just by checking _current_pending_monitor instead.
>
> Thanks,
> Patricio
Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
add precondition assert() + suggested comments
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/3101/files
- new: https://git.openjdk.java.net/jdk/pull/3101/files/5eed17cc..629a17aa
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3101&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3101&range=00-01
Stats: 8 lines in 1 file changed: 6 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/3101.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3101/head:pull/3101
PR: https://git.openjdk.java.net/jdk/pull/3101
More information about the hotspot-runtime-dev
mailing list