< prev index next >
src/share/vm/runtime/objectMonitor.hpp
Print this page
*** 169,178 ****
--- 169,180 ----
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
+ typedef enum { Free = 0, New, Old } AllocationState; // Free must be 0 for monitor to be free after memset(..,0,..).
+ AllocationState _allocation_state;
public:
static void Initialize();
// Only perform a PerfData operation if the PerfData object has been
*** 266,276 ****
void set_owner(void* owner);
jint waiters() const;
jint count() const;
- void set_count(jint count);
jint contentions() const;
intptr_t recursions() const { return _recursions; }
// JVM/TI GetObjectMonitorUsage() needs this:
ObjectWaiter* first_waiter() { return _WaitSet; }
--- 268,277 ----
*** 305,330 ****
public:
void* object() const;
void* object_addr();
void set_object(void* obj);
bool check(TRAPS); // true if the thread owns the monitor.
void check_slow(TRAPS);
void clear();
static void sanity_checks(); // public for -XX:+ExecuteInternalVMTests
// in PRODUCT for -XX:SyncKnobs=Verbose=1
! 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);
! void reenter(intptr_t recursions, TRAPS);
private:
void AddWaiter(ObjectWaiter * waiter);
static void DeferredInitialize();
void INotify(Thread * Self);
--- 306,337 ----
public:
void* object() const;
void* object_addr();
void set_object(void* obj);
+ void set_allocation_state(AllocationState s) { _allocation_state = s; }
+ AllocationState allocation_state() const { return _allocation_state; }
+ bool is_free() const { return _allocation_state == Free; }
+ bool is_active() const { return !is_free(); }
+ bool is_old() const { return _allocation_state == Old; }
+ bool is_new() const { return _allocation_state == New; }
bool check(TRAPS); // true if the thread owns the monitor.
void check_slow(TRAPS);
void clear();
static void sanity_checks(); // public for -XX:+ExecuteInternalVMTests
// in PRODUCT for -XX:SyncKnobs=Verbose=1
! bool enter(TRAPS); // returns false if monitor is being deflated and caller should retry locking the object.
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 deflated and caller should retry locking the object.
private:
void AddWaiter(ObjectWaiter * waiter);
static void DeferredInitialize();
void INotify(Thread * Self);
*** 341,350 ****
--- 348,359 ----
void post_monitor_wait_event(EventJavaMonitorWait * event,
jlong notifier_tid,
jlong timeout,
bool timedout);
+ bool try_disable_monitor(); // Must be run by java thread in VM mode.
+ void install_displaced_markword_in_object();
};
#undef TEVENT
#define TEVENT(nom) { if (SyncVerbose) FEVENT(nom); }
< prev index next >