Lines Matching defs:Self

322   Thread * const Self = THREAD ;
325 cur = Atomic::cmpxchg_ptr (Self, &_owner, NULL) ;
329 assert (_owner == Self, "invariant") ;
334 if (cur == Self) {
340 if (Self->is_lock_owned ((address)cur)) {
345 _owner = Self ;
351 assert (Self->_Stalled == 0, "invariant") ;
352 Self->_Stalled = intptr_t(this) ;
354 // Try one round of spinning *before* enqueueing Self
359 if (Knob_SpinEarly && TrySpin (Self) > 0) {
360 assert (_owner == Self , "invariant") ;
363 Self->_Stalled = 0 ;
367 assert (_owner != Self , "invariant") ;
368 assert (_succ != Self , "invariant") ;
369 assert (Self->is_Java_thread() , "invariant") ;
370 JavaThread * jt = (JavaThread *) Self ;
390 OSThreadContendState osts(Self->osthread());
393 Self->set_current_pending_monitor(this);
413 exit (false, Self) ;
417 Self->set_current_pending_monitor(NULL);
422 Self->_Stalled = 0 ;
426 assert (_owner == Self , "invariant") ;
427 assert (_succ != Self , "invariant") ;
463 int ObjectMonitor::TryLock (Thread * Self) {
467 if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
470 assert (_owner == Self, "invariant") ;
483 Thread * Self = THREAD ;
484 assert (Self->is_Java_thread(), "invariant") ;
485 assert (((JavaThread *) Self)->thread_state() == _thread_blocked , "invariant") ;
488 if (TryLock (Self) > 0) {
489 assert (_succ != Self , "invariant") ;
490 assert (_owner == Self , "invariant") ;
491 assert (_Responsible != Self , "invariant") ;
497 // We try one round of spinning *before* enqueueing Self.
504 if (TrySpin (Self) > 0) {
505 assert (_owner == Self , "invariant") ;
506 assert (_succ != Self , "invariant") ;
507 assert (_Responsible != Self , "invariant") ;
512 assert (_succ != Self , "invariant") ;
513 assert (_owner != Self , "invariant") ;
514 assert (_Responsible != Self , "invariant") ;
516 // Enqueue "Self" on ObjectMonitor's _cxq.
518 // Node acts as a proxy for Self.
526 ObjectWaiter node(Self) ;
527 Self->_ParkEvent->reset() ;
531 // Push "Self" onto the front of the _cxq.
532 // Once on cxq/EntryList, Self stays on-queue until it acquires the lock.
542 if (TryLock (Self) > 0) {
543 assert (_succ != Self , "invariant") ;
544 assert (_owner == Self , "invariant") ;
545 assert (_Responsible != Self , "invariant") ;
575 // CONSIDER: ST vs CAS vs { if (Responsible==null) Responsible=Self }
576 Atomic::cmpxchg_ptr (Self, &_Responsible, NULL) ;
596 if (TryLock (Self) > 0) break ;
597 assert (_owner != Self, "invariant") ;
600 Atomic::cmpxchg_ptr (Self, &_Responsible, NULL) ;
604 if (_Responsible == Self || (SyncFlags & 1)) {
606 Self->_ParkEvent->park ((jlong) RecheckInterval) ;
612 Self->_ParkEvent->park() ;
615 if (TryLock(Self) > 0) break ;
628 // Assuming this is not a spurious wakeup we'll normally find _succ == Self.
630 // TrySpin() must tolerate being called with _succ == Self.
632 if ((Knob_SpinAfterFutile & 1) && TrySpin (Self) > 0) break ;
642 if ((Knob_ResetEvent & 1) && Self->_ParkEvent->fired()) {
643 Self->_ParkEvent->reset() ;
646 if (_succ == Self) _succ = NULL ;
653 // Self has acquired the lock -- Unlink Self from the cxq or EntryList.
654 // Normally we'll find Self on the EntryList .
658 // In addition, Self.TState is stable.
660 assert (_owner == Self , "invariant") ;
666 UnlinkAfterAcquire (Self, &node) ;
667 if (_succ == Self) _succ = NULL ;
669 assert (_succ != Self, "invariant") ;
670 if (_Responsible == Self) {
731 void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
732 assert (Self != NULL , "invariant") ;
734 assert (SelfNode->_thread == Self , "invariant") ;
737 assert (((JavaThread *)Self)->thread_state() != _thread_blocked, "invariant") ;
738 JavaThread * jt = (JavaThread *) Self ;
744 assert (_owner != Self, "invariant") ;
746 if (TryLock (Self) > 0) break ;
747 if (TrySpin (Self) > 0) break ;
755 OSThreadContendState osts(Self->osthread());
762 Self->_ParkEvent->park ((jlong)1000) ;
764 Self->_ParkEvent->park () ;
770 if (_succ == Self) { _succ = NULL; OrderAccess::fence(); }
779 if (TryLock(Self) > 0) break ;
790 // find that _succ == Self.
791 if (_succ == Self) _succ = NULL ;
802 // Self has acquired the lock -- Unlink Self from the cxq or EntryList .
803 // Normally we'll find Self on the EntryList.
808 // In addition, Self.TState is stable.
810 assert (_owner == Self, "invariant") ;
812 UnlinkAfterAcquire (Self, SelfNode) ;
813 if (_succ == Self) _succ = NULL ;
814 assert (_succ != Self, "invariant") ;
822 void ObjectMonitor::UnlinkAfterAcquire (Thread * Self, ObjectWaiter * SelfNode)
824 assert (_owner == Self, "invariant") ;
825 assert (SelfNode->_thread == Self, "invariant") ;
828 // Normal case: remove Self from the DLL EntryList .
840 // Inopportune interleaving -- Self is still on the cxq.
842 // Normally we'll find Self near the front of the cxq, so
847 // Dequeue Self from either the head (with CAS) or from the interior
849 // CONSIDER: if Self is on the cxq then simply drain cxq into EntryList
850 // and then unlink Self from EntryList. We have to drain eventually,
857 // In that case Self must be in the interior and can no longer be
937 Thread * Self = THREAD ;
977 _previous_owner_tid = SharedRuntime::get_java_tid(Self);
1090 ExitEpilog (Self, w) ;
1169 // I'd like to write: guarantee (w->_thread != Self).
1179 // associated with Self.
1181 ExitEpilog (Self, w) ;
1207 // "Self" still holds the outer-lock, restricting parallelism
1254 ExitEpilog (Self, w) ;
1286 // ST Self->_suspend_equivalent = false
1307 void ObjectMonitor::ExitEpilog (Thread * Self, ObjectWaiter * Wakee) {
1308 assert (_owner == Self, "invariant") ;
1332 DTRACE_MONITOR_PROBE(contended__exit, this, object(), Self);
1352 Thread * const Self = THREAD;
1353 assert(Self->is_Java_thread(), "Must be Java thread!");
1367 guarantee(Self == _owner, "complete_exit not owner");
1370 exit (true, Self) ; // exit the monitor
1371 guarantee (_owner != Self, "invariant");
1378 Thread * const Self = THREAD;
1379 assert(Self->is_Java_thread(), "Must be Java thread!");
1382 guarantee(_owner != Self, "reenter already owner");
1444 Thread * const Self = THREAD ;
1445 assert(Self->is_Java_thread(), "Must be Java thread!");
1456 if (interruptible && Thread::is_interrupted(Self, true) && !HAS_PENDING_EXCEPTION) {
1473 assert (Self->_Stalled == 0, "invariant") ;
1474 Self->_Stalled = intptr_t(this) ;
1480 ObjectWaiter node(Self);
1482 Self->_ParkEvent->reset() ;
1502 exit (true, Self) ; // exit the monitor
1503 guarantee (_owner != Self, "invariant") ;
1516 if (node._notified != 0 && _succ == Self) {
1530 OSThread* osthread = Self->osthread();
1542 Self->_ParkEvent->park () ;
1544 ret = Self->_ParkEvent->park (millis) ;
1550 // TODO-FIXME: add -- if succ == Self then succ = null.
1588 if (_succ == Self) _succ = NULL ;
1609 assert (Self->_Stalled != 0, "invariant") ;
1610 Self->_Stalled = 0 ;
1612 assert (_owner != Self, "invariant") ;
1615 enter (Self) ;
1618 ReenterI (Self, &node) ;
1622 // Self has reacquired the lock.
1623 // Lifecycle - the node representing Self must not appear on any queues.
1627 assert (_owner == Self, "invariant") ;
1628 assert (_succ != Self , "invariant") ;
1638 assert (_owner == Self , "invariant") ;
1639 assert (_succ != Self , "invariant") ;
1650 if (interruptible && Thread::is_interrupted(Self, true) && !HAS_PENDING_EXCEPTION) {
1686 Thread * Self = THREAD;
1687 iterator->_notifier_tid = Self->osthread()->thread_id();
1812 Thread * Self = THREAD;
1813 iterator->_notifier_tid = Self->osthread()->thread_id();
1980 int ObjectMonitor::TrySpin_VaryDuration (Thread * Self) {
1986 if (TryLock (Self) > 0) return 1 ;
1993 if (TryLock(Self) > 0) {
2026 if (Knob_OState && NotRunnable (Self, (Thread *) _owner)) {
2050 if (sss && _succ == NULL ) _succ = Self ;
2119 ox = (Thread *) Atomic::cmpxchg_ptr (Self, &_owner, NULL) ;
2123 if (sss && _succ == Self) {
2169 if (Knob_OState && NotRunnable (Self, ox)) {
2173 if (sss && _succ == NULL ) _succ = Self ;
2193 if (sss && _succ == Self) {
2200 if (TryLock(Self) > 0) return 1 ;
2244 int ObjectMonitor::NotRunnable (Thread * Self, Thread * ox) {