< prev index next >
src/hotspot/share/runtime/objectMonitor.hpp
Print this page
rev 54612 : Checkpoint latest preliminary review patches for full OpenJDK review; merge with 8222295.patch.
rev 54613 : imported patch dcubed.monitor_deflate_conc.v2.01
rev 54615 : imported patch dcubed.monitor_deflate_conc.v2.03
@@ -166,17 +166,19 @@
volatile int _Spinner; // for exit->spinner handoff optimization
volatile int _SpinDuration;
volatile jint _contentions; // Number of active contentions in enter(). It is used by is_busy()
// along with other fields to determine if an ObjectMonitor can be
- // deflated. See ObjectSynchronizer::deflate_monitor().
+ // deflated. See ObjectSynchronizer::deflate_monitor() and
+ // ObjectSynchronizer::deflate_monitor_using_JT().
protected:
ObjectWaiter * volatile _WaitSet; // LL of threads wait()ing on the monitor
volatile jint _waiters; // number of waiting threads
private:
volatile int _WaitSetLock; // protects Wait Queue - simple spinlock
- volatile jint _ref_count; // ref count for ObjectMonitor*
+ volatile jint _ref_count; // ref count for ObjectMonitor* and used by the async deflation
+ // protocol. See ObjectSynchronizer::deflate_monitor_using_JT().
typedef enum {
Free = 0, // Free must be 0 for monitor to be free after memset(..,0,..).
New,
Old
} AllocationState;
@@ -247,20 +249,17 @@
// use which is orthogonal to whether the ObjectMonitor itself
// is in use for a locking operation.
return _contentions|_waiters|intptr_t(_owner)|intptr_t(_cxq)|intptr_t(_EntryList);
}
- // Version of is_busy() that accounts for special values in
- // _contentions and _owner when AsyncDeflateIdleMonitors is enabled.
+ // Version of is_busy() that accounts for the special value in
+ // _owner when AsyncDeflateIdleMonitors is enabled.
intptr_t is_busy_async() const {
- intptr_t ret_code = _waiters | intptr_t(_cxq) | intptr_t(_EntryList);
+ intptr_t ret_code = _contentions | _waiters | intptr_t(_cxq) | intptr_t(_EntryList);
if (!AsyncDeflateIdleMonitors) {
- ret_code |= _contentions | intptr_t(_owner);
+ ret_code |= intptr_t(_owner);
} else {
- if (_contentions > 0) {
- ret_code |= _contentions;
- }
if (_owner != DEFLATER_MARKER) {
ret_code |= intptr_t(_owner);
}
}
return ret_code;
@@ -324,19 +323,19 @@
bool check(TRAPS); // true if the thread owns the monitor.
void check_slow(TRAPS);
void clear();
void clear_using_JT();
- bool enter(TRAPS); // Returns false if monitor is being async deflated and caller should retry locking the object.
+ void enter(TRAPS);
void exit(bool not_suspended, TRAPS);
void wait(jlong millis, bool interruptable, TRAPS);
void notify(TRAPS);
void notifyAll(TRAPS);
// Use the following at your own risk
intptr_t complete_exit(TRAPS);
- bool reenter(intptr_t recursions, TRAPS); // Returns false if monitor is being async deflated and caller should retry locking the object.
+ void reenter(intptr_t recursions, TRAPS);
private:
void AddWaiter(ObjectWaiter * waiter);
void INotify(Thread * Self);
ObjectWaiter * DequeueWaiter();
< prev index next >