Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263896: Make not_suspended parameter from ObjectMonitor::exit() have default value #3101

wants to merge 3 commits into from
Changes from 1 commit
File filter
Filter file types
Jump to
Jump to file
Failed to load files.


Just for now

@@ -388,6 +388,7 @@ bool ObjectMonitor::enter(JavaThread* current) {
{ // Change java thread status to indicate blocked on monitor enter.
JavaThreadBlockedOnMonitorEnterState jtbmes(current, this);

assert(current->current_pending_monitor() == NULL, "invariant");

This comment has been minimized.


dholmes-ora Mar 29, 2021

Really this belongs inside set_current_pending_monitor() where the only allowed transitions are null to non-null, and non-null to null. But that would be a separate RFE.


DTRACE_MONITOR_PROBE(contended__enter, this, object(), current);
@@ -421,6 +422,9 @@ bool ObjectMonitor::enter(JavaThread* current) {
_recursions = 0;
_succ = NULL;
// make sure 'this' is still set as pending monitor so that exit()
// doesn't set _previous_owner_tid for this special case.
assert(current->current_pending_monitor() == this, "invariant");

@@ -1178,8 +1182,10 @@ void ObjectMonitor::exit(JavaThread* current) {
_Responsible = NULL;

// set _previous_owner_tid for the MonitorEnter event if it is enabled and
// the thread isn't releasing the monitor from inside enter()
// Set _previous_owner_tid for the MonitorEnter event if it is enabled and
// we legitimately owned this monitor. We can also get here if we need to self-suspend
// in enter(), in which case we never really owned this monitor and so should not record
// our thread id. In that case current_pending_monitor() is non-NULL.
if (current->current_pending_monitor() == NULL && EventJavaMonitorEnter::is_enabled()) {
_previous_owner_tid = JFR_THREAD_ID(current);
ProTip! Use n and p to navigate between commits in a pull request.