Skip to content

Commit 2ad6f2d

Browse files
committed
8263896: Make not_suspended parameter from ObjectMonitor::exit() have default value
Reviewed-by: rehn, dcubed, dholmes
1 parent b652198 commit 2ad6f2d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/hotspot/share/runtime/objectMonitor.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ bool ObjectMonitor::enter(JavaThread* current) {
388388
{ // Change java thread status to indicate blocked on monitor enter.
389389
JavaThreadBlockedOnMonitorEnterState jtbmes(current, this);
390390

391+
assert(current->current_pending_monitor() == NULL, "invariant");
391392
current->set_current_pending_monitor(this);
392393

393394
DTRACE_MONITOR_PROBE(contended__enter, this, object(), current);
@@ -421,7 +422,7 @@ bool ObjectMonitor::enter(JavaThread* current) {
421422
//
422423
_recursions = 0;
423424
_succ = NULL;
424-
exit(false, current);
425+
exit(current, false /* not_suspended */);
425426

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

1142-
void ObjectMonitor::exit(bool not_suspended, JavaThread* current) {
1143+
void ObjectMonitor::exit(JavaThread* current, bool not_suspended) {
11431144
void* cur = owner_raw();
11441145
if (current != cur) {
11451146
if (current->is_lock_owned((address)cur)) {
@@ -1372,7 +1373,7 @@ intx ObjectMonitor::complete_exit(JavaThread* current) {
13721373
guarantee(current == owner_raw(), "complete_exit not owner");
13731374
intx save = _recursions; // record the old recursion count
13741375
_recursions = 0; // set the recursion level to be 0
1375-
exit(true, current); // exit the monitor
1376+
exit(current); // exit the monitor
13761377
guarantee(owner_raw() != current, "invariant");
13771378
return save;
13781379
}
@@ -1506,7 +1507,7 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
15061507
intx save = _recursions; // record the old recursion count
15071508
_waiters++; // increment the number of waiters
15081509
_recursions = 0; // set the recursion level to be 1
1509-
exit(true, current); // exit the monitor
1510+
exit(current); // exit the monitor
15101511
guarantee(owner_raw() != current, "invariant");
15111512

15121513
// The thread is on the WaitSet list - now park() it.

src/hotspot/share/runtime/objectMonitor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
303303
bool check_owner(TRAPS);
304304

305305
bool enter(JavaThread* current);
306-
void exit(bool not_suspended, JavaThread* current);
306+
void exit(JavaThread* current, bool not_suspended = true);
307307
void wait(jlong millis, bool interruptible, TRAPS);
308308
void notify(TRAPS);
309309
void notifyAll(TRAPS);

src/hotspot/share/runtime/synchronizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ void ObjectSynchronizer::exit(oop object, BasicLock* lock, JavaThread* current)
518518
// The ObjectMonitor* can't be async deflated until ownership is
519519
// dropped inside exit() and the ObjectMonitor* must be !is_busy().
520520
ObjectMonitor* monitor = inflate(current, object, inflate_cause_vm_internal);
521-
monitor->exit(true, current);
521+
monitor->exit(current);
522522
}
523523

524524
// -----------------------------------------------------------------------------
@@ -608,7 +608,7 @@ void ObjectSynchronizer::jni_exit(oop obj, TRAPS) {
608608
// intentionally do not use CHECK on check_owner because we must exit the
609609
// monitor even if an exception was already pending.
610610
if (monitor->check_owner(THREAD)) {
611-
monitor->exit(true, current);
611+
monitor->exit(current);
612612
}
613613
}
614614

0 commit comments

Comments
 (0)