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()
305 void Mutex::ExclusiveLock(Thread* self) { in ExclusiveLock() argument
306 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLock()
308 AssertNotHeld(self); in ExclusiveLock()
310 if (!recursive_ || !IsExclusiveHeld(self)) { in ExclusiveLock()
320 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLock()
337 exclusive_owner_ = SafeGetTid(self); in ExclusiveLock()
338 RegisterAsLocked(self); in ExclusiveLock()
344 AssertHeld(self); in ExclusiveLock()
348 bool Mutex::ExclusiveTryLock(Thread* self) { in ExclusiveTryLock() argument
349 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveTryLock()
351 AssertNotHeld(self); in ExclusiveTryLock()
353 if (!recursive_ || !IsExclusiveHeld(self)) { in ExclusiveTryLock()
377 exclusive_owner_ = SafeGetTid(self); in ExclusiveTryLock()
378 RegisterAsLocked(self); in ExclusiveTryLock()
384 AssertHeld(self); in ExclusiveTryLock()
389 void Mutex::ExclusiveUnlock(Thread* self) { in ExclusiveUnlock() argument
390 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveUnlock()
391 AssertHeld(self); in ExclusiveUnlock()
399 RegisterAsUnlocked(self); in ExclusiveUnlock()
484 void ReaderWriterMutex::ExclusiveLock(Thread* self) { in ExclusiveLock() argument
485 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLock()
486 AssertNotExclusiveHeld(self); in ExclusiveLock()
496 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLock()
513 exclusive_owner_ = SafeGetTid(self); in ExclusiveLock()
514 RegisterAsLocked(self); in ExclusiveLock()
515 AssertExclusiveHeld(self); in ExclusiveLock()
518 void ReaderWriterMutex::ExclusiveUnlock(Thread* self) { in ExclusiveUnlock() argument
519 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveUnlock()
520 AssertExclusiveHeld(self); in ExclusiveUnlock()
521 RegisterAsUnlocked(self); in ExclusiveUnlock()
553 bool ReaderWriterMutex::ExclusiveLockWithTimeout(Thread* self, int64_t ms, int32_t ns) { in ExclusiveLockWithTimeout() argument
554 DCHECK(self == NULL || self == Thread::Current()); in ExclusiveLockWithTimeout()
572 ScopedContentionRecorder scr(this, SafeGetTid(self), GetExclusiveOwnerTid()); in ExclusiveLockWithTimeout()
600 exclusive_owner_ = SafeGetTid(self); in ExclusiveLockWithTimeout()
601 RegisterAsLocked(self); in ExclusiveLockWithTimeout()
602 AssertSharedHeld(self); in ExclusiveLockWithTimeout()
607 bool ReaderWriterMutex::SharedTryLock(Thread* self) { in SharedTryLock() argument
608 DCHECK(self == NULL || self == Thread::Current()); in SharedTryLock()
631 RegisterAsLocked(self); in SharedTryLock()
632 AssertSharedHeld(self); in SharedTryLock()
636 bool ReaderWriterMutex::IsSharedHeld(const Thread* self) const { in IsSharedHeld()
637 DCHECK(self == NULL || self == Thread::Current()); in IsSharedHeld()
639 if (UNLIKELY(self == NULL)) { // Handle unattached threads. in IsSharedHeld()
640 result = IsExclusiveHeld(self); // TODO: a better best effort here. in IsSharedHeld()
642 result = (self->GetHeldMutex(level_) == this); in IsSharedHeld()
697 void ConditionVariable::Broadcast(Thread* self) { in Broadcast() argument
698 DCHECK(self == NULL || self == Thread::Current()); in Broadcast()
701 DCHECK_EQ(guard_.GetExclusiveOwnerTid(), SafeGetTid(self)); in Broadcast()
725 void ConditionVariable::Signal(Thread* self) { in Signal() argument
726 DCHECK(self == NULL || self == Thread::Current()); in Signal()
727 guard_.AssertExclusiveHeld(self); in Signal()
742 void ConditionVariable::Wait(Thread* self) { in Wait() argument
743 guard_.CheckSafeToWait(self); in Wait()
744 WaitHoldingLocks(self); in Wait()
747 void ConditionVariable::WaitHoldingLocks(Thread* self) { in WaitHoldingLocks() argument
748 DCHECK(self == NULL || self == Thread::Current()); in WaitHoldingLocks()
749 guard_.AssertExclusiveHeld(self); in WaitHoldingLocks()
757 guard_.ExclusiveUnlock(self); in WaitHoldingLocks()
766 guard_.ExclusiveLock(self); in WaitHoldingLocks()
782 void ConditionVariable::TimedWait(Thread* self, int64_t ms, int32_t ns) { in TimedWait() argument
783 DCHECK(self == NULL || self == Thread::Current()); in TimedWait()
784 guard_.AssertExclusiveHeld(self); in TimedWait()
785 guard_.CheckSafeToWait(self); in TimedWait()
795 guard_.ExclusiveUnlock(self); in TimedWait()
805 guard_.ExclusiveLock(self); in TimedWait()