Lines Matching refs:self
150 void BaseMutex::CheckSafeToWait(Thread* self) { in CheckSafeToWait() argument
151 if (self == NULL) { in CheckSafeToWait()
156 CHECK(self->GetHeldMutex(level_) == this || level_ == kMonitorLock) in CheckSafeToWait()
161 BaseMutex* held_mutex = self->GetHeldMutex(static_cast<LockLevel>(i)); in CheckSafeToWait()
313 void Mutex::ExclusiveLock(Thread* self) { in ExclusiveLock() argument
314 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLock()
316 AssertNotHeld(self); in ExclusiveLock()
318 if (!recursive_ || !IsExclusiveHeld(self)) { in ExclusiveLock()
328 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLock()
345 exclusive_owner_ = SafeGetTid(self); in ExclusiveLock()
346 RegisterAsLocked(self); in ExclusiveLock()
352 AssertHeld(self); in ExclusiveLock()
356 bool Mutex::ExclusiveTryLock(Thread* self) { in ExclusiveTryLock() argument
357 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveTryLock()
359 AssertNotHeld(self); in ExclusiveTryLock()
361 if (!recursive_ || !IsExclusiveHeld(self)) { in ExclusiveTryLock()
385 exclusive_owner_ = SafeGetTid(self); in ExclusiveTryLock()
386 RegisterAsLocked(self); in ExclusiveTryLock()
392 AssertHeld(self); in ExclusiveTryLock()
397 void Mutex::ExclusiveUnlock(Thread* self) { in ExclusiveUnlock() argument
398 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveUnlock()
399 AssertHeld(self); in ExclusiveUnlock()
407 RegisterAsUnlocked(self); in ExclusiveUnlock()
492 void ReaderWriterMutex::ExclusiveLock(Thread* self) { in ExclusiveLock() argument
493 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLock()
494 AssertNotExclusiveHeld(self); in ExclusiveLock()
504 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLock()
521 exclusive_owner_ = SafeGetTid(self); in ExclusiveLock()
522 RegisterAsLocked(self); in ExclusiveLock()
523 AssertExclusiveHeld(self); in ExclusiveLock()
526 void ReaderWriterMutex::ExclusiveUnlock(Thread* self) { in ExclusiveUnlock() argument
527 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveUnlock()
528 AssertExclusiveHeld(self); in ExclusiveUnlock()
529 RegisterAsUnlocked(self); in ExclusiveUnlock()
561 bool ReaderWriterMutex::ExclusiveLockWithTimeout(Thread* self, int64_t ms, int32_t ns) { in ExclusiveLockWithTimeout() argument
562 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLockWithTimeout()
580 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLockWithTimeout()
608 exclusive_owner_ = SafeGetTid(self); in ExclusiveLockWithTimeout()
609 RegisterAsLocked(self); in ExclusiveLockWithTimeout()
610 AssertSharedHeld(self); in ExclusiveLockWithTimeout()
615 bool ReaderWriterMutex::SharedTryLock(Thread* self) { in SharedTryLock() argument
616 DCHECK(self == NULL || self == Thread::Current()); in SharedTryLock()
639 RegisterAsLocked(self); in SharedTryLock()
640 AssertSharedHeld(self); in SharedTryLock()
644 bool ReaderWriterMutex::IsSharedHeld(const Thread* self) const { in IsSharedHeld()
645 DCHECK(self == NULL || self == Thread::Current()); in IsSharedHeld()
647 if (UNLIKELY(self == NULL)) { // Handle unattached threads. in IsSharedHeld()
648 result = IsExclusiveHeld(self); // TODO: a better best effort here. in IsSharedHeld()
650 result = (self->GetHeldMutex(level_) == this); in IsSharedHeld()
711 void ConditionVariable::Broadcast(Thread* self) { in Broadcast() argument
712 DCHECK(self == NULL || self == Thread::Current()); in Broadcast()
715 DCHECK_EQ(guard_.GetExclusiveOwnerTid(), SafeGetTid(self)); in Broadcast()
739 void ConditionVariable::Signal(Thread* self) { in Signal() argument
740 DCHECK(self == NULL || self == Thread::Current()); in Signal()
741 guard_.AssertExclusiveHeld(self); in Signal()
756 void ConditionVariable::Wait(Thread* self) { in Wait() argument
757 guard_.CheckSafeToWait(self); in Wait()
758 WaitHoldingLocks(self); in Wait()
761 void ConditionVariable::WaitHoldingLocks(Thread* self) { in WaitHoldingLocks() argument
762 DCHECK(self == NULL || self == Thread::Current()); in WaitHoldingLocks()
763 guard_.AssertExclusiveHeld(self); in WaitHoldingLocks()
771 guard_.ExclusiveUnlock(self); in WaitHoldingLocks()
780 guard_.ExclusiveLock(self); in WaitHoldingLocks()
796 void ConditionVariable::TimedWait(Thread* self, int64_t ms, int32_t ns) { in TimedWait() argument
797 DCHECK(self == NULL || self == Thread::Current()); in TimedWait()
798 guard_.AssertExclusiveHeld(self); in TimedWait()
799 guard_.CheckSafeToWait(self); in TimedWait()
809 guard_.ExclusiveUnlock(self); in TimedWait()
819 guard_.ExclusiveLock(self); in TimedWait()