Lines Matching refs:self
51 static inline pid_t SafeGetTid(const Thread* self) { in SafeGetTid() argument
52 if (self != nullptr) { in SafeGetTid()
53 return self->GetTid(); in SafeGetTid()
91 inline void BaseMutex::RegisterAsLocked(Thread* self) { in RegisterAsLocked() argument
92 if (UNLIKELY(self == nullptr)) { in RegisterAsLocked()
102 if (UNLIKELY(level == kThreadWaitLock) && self->GetHeldMutex(kThreadWaitLock) != nullptr) { in RegisterAsLocked()
113 Locks::mutator_lock_->IsSharedHeld(self) && in RegisterAsLocked()
114 !Locks::mutator_lock_->IsExclusiveHeld(self)) { in RegisterAsLocked()
121 } else if (this == Locks::mutator_lock_ && self->GetHeldMutex(kTopLockLevel) != nullptr) { in RegisterAsLocked()
123 << "kTopLevelLock (" << self->GetHeldMutex(kTopLockLevel)->name_ << "held is " in RegisterAsLocked()
129 BaseMutex* held_mutex = self->GetHeldMutex(lock_level_i); in RegisterAsLocked()
132 Locks::mutator_lock_->IsExclusiveHeld(self)) { in RegisterAsLocked()
153 self->SetHeldMutex(level, this); in RegisterAsLocked()
157 inline void BaseMutex::RegisterAsUnlocked(Thread* self) { in RegisterAsUnlocked() argument
158 if (UNLIKELY(self == nullptr)) { in RegisterAsUnlocked()
164 if (UNLIKELY(level == kThreadWaitLock) && self->GetHeldMutex(kThreadWaitWakeLock) == this) { in RegisterAsUnlocked()
169 …CHECK(self->GetHeldMutex(kThreadWaitLock) != nullptr) << "Held " << kThreadWaitWakeLock << " witho… in RegisterAsUnlocked()
171 CHECK(self->GetHeldMutex(level) == this) << "Unlocking on unacquired mutex: " << name_; in RegisterAsUnlocked()
173 self->SetHeldMutex(level, nullptr); in RegisterAsUnlocked()
177 inline void ReaderWriterMutex::SharedLock(Thread* self) { in SharedLock() argument
178 DCHECK(self == nullptr || self == Thread::Current()); in SharedLock()
187 HandleSharedLockContention(self, cur_state); in SharedLock()
194 RegisterAsLocked(self); in SharedLock()
195 AssertSharedHeld(self); in SharedLock()
198 inline void ReaderWriterMutex::SharedUnlock(Thread* self) { in SharedUnlock() argument
199 DCHECK(self == nullptr || self == Thread::Current()); in SharedUnlock()
201 AssertSharedHeld(self); in SharedUnlock()
202 RegisterAsUnlocked(self); in SharedUnlock()
226 inline bool Mutex::IsExclusiveHeld(const Thread* self) const { in IsExclusiveHeld() argument
227 DCHECK(self == nullptr || self == Thread::Current()); in IsExclusiveHeld()
228 bool result = (GetExclusiveOwnerTid() == SafeGetTid(self)); in IsExclusiveHeld()
231 if (result && self != nullptr && level_ != kMonitorLock && !gAborting) { in IsExclusiveHeld()
232 if (level_ == kThreadWaitLock && self->GetHeldMutex(kThreadWaitLock) != this) { in IsExclusiveHeld()
233 CHECK_EQ(self->GetHeldMutex(kThreadWaitWakeLock), this); in IsExclusiveHeld()
235 CHECK_EQ(self->GetHeldMutex(level_), this); in IsExclusiveHeld()
246 inline void Mutex::AssertExclusiveHeld(const Thread* self) const { in AssertExclusiveHeld() argument
248 CHECK(IsExclusiveHeld(self)) << *this; in AssertExclusiveHeld()
252 inline void Mutex::AssertHeld(const Thread* self) const { in AssertHeld() argument
253 AssertExclusiveHeld(self); in AssertHeld()
256 inline bool ReaderWriterMutex::IsExclusiveHeld(const Thread* self) const { in IsExclusiveHeld() argument
257 DCHECK(self == nullptr || self == Thread::Current()); in IsExclusiveHeld()
258 bool result = (GetExclusiveOwnerTid() == SafeGetTid(self)); in IsExclusiveHeld()
261 if (self != nullptr && result) { in IsExclusiveHeld()
262 CHECK_EQ(self->GetHeldMutex(level_), this); in IsExclusiveHeld()
283 inline void ReaderWriterMutex::AssertExclusiveHeld(const Thread* self) const { in AssertExclusiveHeld() argument
285 CHECK(IsExclusiveHeld(self)) << *this; in AssertExclusiveHeld()
289 inline void ReaderWriterMutex::AssertWriterHeld(const Thread* self) const { in AssertWriterHeld() argument
290 AssertExclusiveHeld(self); in AssertWriterHeld()
293 inline void MutatorMutex::TransitionFromRunnableToSuspended(Thread* self) { in TransitionFromRunnableToSuspended() argument
294 AssertSharedHeld(self); in TransitionFromRunnableToSuspended()
295 RegisterAsUnlocked(self); in TransitionFromRunnableToSuspended()
298 inline void MutatorMutex::TransitionFromSuspendedToRunnable(Thread* self) { in TransitionFromSuspendedToRunnable() argument
299 RegisterAsLocked(self); in TransitionFromSuspendedToRunnable()
300 AssertSharedHeld(self); in TransitionFromSuspendedToRunnable()
303 inline ReaderMutexLock::ReaderMutexLock(Thread* self, ReaderWriterMutex& mu) in ReaderMutexLock() argument
304 : self_(self), mu_(mu) { in ReaderMutexLock()