268 // TODO: add stronger asserts ...
269 // _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
270 // _contentions == 0 EntryList == NULL
271 // _recursions == 0 _WaitSet == NULL
272 DEBUG_ONLY(stringStream ss;)
273 assert((is_busy() | _recursions) == 0, "freeing in-use monitor: %s, "
274 "recursions=" INTPTR_FORMAT, is_busy_to_string(&ss), _recursions);
275 _succ = NULL;
276 _EntryList = NULL;
277 _cxq = NULL;
278 _WaitSet = NULL;
279 _recursions = 0;
280 }
281
282 public:
283
284 void* object() const;
285 void* object_addr();
286 void set_object(void* obj);
287
288 bool check(TRAPS); // true if the thread owns the monitor.
289 void check_slow(TRAPS);
290 void clear();
291
292 void enter(TRAPS);
293 void exit(bool not_suspended, TRAPS);
294 void wait(jlong millis, bool interruptable, TRAPS);
295 void notify(TRAPS);
296 void notifyAll(TRAPS);
297
298 void print() const;
299 void print_on(outputStream* st) const;
300
301 // Use the following at your own risk
302 intptr_t complete_exit(TRAPS);
303 void reenter(intptr_t recursions, TRAPS);
304
305 private:
306 void AddWaiter(ObjectWaiter * waiter);
307 void INotify(Thread * Self);
308 ObjectWaiter * DequeueWaiter();
309 void DequeueSpecificWaiter(ObjectWaiter * waiter);
|
268 // TODO: add stronger asserts ...
269 // _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
270 // _contentions == 0 EntryList == NULL
271 // _recursions == 0 _WaitSet == NULL
272 DEBUG_ONLY(stringStream ss;)
273 assert((is_busy() | _recursions) == 0, "freeing in-use monitor: %s, "
274 "recursions=" INTPTR_FORMAT, is_busy_to_string(&ss), _recursions);
275 _succ = NULL;
276 _EntryList = NULL;
277 _cxq = NULL;
278 _WaitSet = NULL;
279 _recursions = 0;
280 }
281
282 public:
283
284 void* object() const;
285 void* object_addr();
286 void set_object(void* obj);
287
288 // Returns true if the specified thread owns the ObjectMonitor. Otherwise
289 // returns false and throws IllegalMonitorStateException (IMSE).
290 bool check_owner(Thread* THREAD);
291 void clear();
292
293 void enter(TRAPS);
294 void exit(bool not_suspended, TRAPS);
295 void wait(jlong millis, bool interruptable, TRAPS);
296 void notify(TRAPS);
297 void notifyAll(TRAPS);
298
299 void print() const;
300 void print_on(outputStream* st) const;
301
302 // Use the following at your own risk
303 intptr_t complete_exit(TRAPS);
304 void reenter(intptr_t recursions, TRAPS);
305
306 private:
307 void AddWaiter(ObjectWaiter * waiter);
308 void INotify(Thread * Self);
309 ObjectWaiter * DequeueWaiter();
310 void DequeueSpecificWaiter(ObjectWaiter * waiter);
|