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

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

Always

Just for now

@@ -422,10 +422,7 @@ 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");
exit(current);
exit(current, false /* not_suspended */);

current->java_suspend_self();
}
@@ -1143,7 +1140,7 @@ void ObjectMonitor::UnlinkAfterAcquire(JavaThread* current, ObjectWaiter* curren
// structured the code so the windows are short and the frequency
// of such futile wakups is low.

void ObjectMonitor::exit(JavaThread* current) {
void ObjectMonitor::exit(JavaThread* current, bool not_suspended) {
void* cur = owner_raw();
if (current != cur) {
if (current->is_lock_owned((address)cur)) {
@@ -1182,11 +1179,9 @@ void ObjectMonitor::exit(JavaThread* current) {
_Responsible = NULL;

#if INCLUDE_JFR
// 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()) {
// get the owner's thread id for the MonitorEnter event
// if it is enabled and the thread isn't suspended
if (not_suspended && EventJavaMonitorEnter::is_enabled()) {
_previous_owner_tid = JFR_THREAD_ID(current);
}
#endif
@@ -303,7 +303,7 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
bool check_owner(TRAPS);

bool enter(JavaThread* current);
void exit(JavaThread* current);
void exit(JavaThread* current, bool not_suspended = true);
void wait(jlong millis, bool interruptible, TRAPS);
void notify(TRAPS);
void notifyAll(TRAPS);
ProTip! Use n and p to navigate between commits in a pull request.