Lines Matching refs:self

49 static inline uint64_t SafeGetTid(const Thread* self) {
50 if (self != nullptr) {
51 return static_cast<uint64_t>(self->GetTid());
72 // no longer exist and so we expect an unlock with no self.
81 inline void BaseMutex::RegisterAsLocked(Thread* self) {
82 if (UNLIKELY(self == nullptr)) {
90 BaseMutex* held_mutex = self->GetHeldMutex(static_cast<LockLevel>(i));
109 self->SetHeldMutex(level_, this);
113 inline void BaseMutex::RegisterAsUnlocked(Thread* self) {
114 if (UNLIKELY(self == nullptr)) {
120 CHECK(self->GetHeldMutex(level_) == this) << "Unlocking on unacquired mutex: " << name_;
122 self->SetHeldMutex(level_, nullptr);
126 inline void ReaderWriterMutex::SharedLock(Thread* self) {
127 DCHECK(self == nullptr || self == Thread::Current());
136 HandleSharedLockContention(self, cur_state);
143 RegisterAsLocked(self);
144 AssertSharedHeld(self);
147 inline void ReaderWriterMutex::SharedUnlock(Thread* self) {
148 DCHECK(self == nullptr || self == Thread::Current());
150 AssertSharedHeld(self);
151 RegisterAsUnlocked(self);
178 inline bool Mutex::IsExclusiveHeld(const Thread* self) const {
179 DCHECK(self == nullptr || self == Thread::Current());
180 bool result = (GetExclusiveOwnerTid() == SafeGetTid(self));
183 if (result && self != nullptr && level_ != kMonitorLock && !gAborting) {
184 CHECK_EQ(self->GetHeldMutex(level_), this);
194 inline bool ReaderWriterMutex::IsExclusiveHeld(const Thread* self) const {
195 DCHECK(self == nullptr || self == Thread::Current());
196 bool result = (GetExclusiveOwnerTid() == SafeGetTid(self));
199 if (self != nullptr && result) {
200 CHECK_EQ(self->GetHeldMutex(level_), this);
221 inline void MutatorMutex::TransitionFromRunnableToSuspended(Thread* self) {
222 AssertSharedHeld(self);
223 RegisterAsUnlocked(self);
226 inline void MutatorMutex::TransitionFromSuspendedToRunnable(Thread* self) {
227 RegisterAsLocked(self);
228 AssertSharedHeld(self);