• Home
  • Raw
  • Download

Lines Matching refs:self

66 static void updateDeadlockPrediction(Thread* self, Object* obj);
385 static void logContentionEvent(Thread *self, u4 waitMs, u4 samplePercent, in logContentionEvent() argument
398 saveArea = SAVEAREA_FROM_FP(self->curFrame); in logContentionEvent()
414 bool isMainThread = (self->systemTid == getpid()); in logContentionEvent()
418 selfName = dvmGetThreadName(self); in logContentionEvent()
459 static void lockMonitor(Thread* self, Monitor* mon) in lockMonitor() argument
465 if (mon->owner == self) { in lockMonitor()
470 oldStatus = dvmChangeStatus(self, THREAD_MONITOR); in lockMonitor()
482 dvmChangeStatus(self, oldStatus); in lockMonitor()
491 logContentionEvent(self, waitMs, samplePercent, in lockMonitor()
496 mon->owner = self; in lockMonitor()
505 if (self->curFrame == NULL) { in lockMonitor()
507 } else if ((saveArea = SAVEAREA_FROM_FP(self->curFrame)) == NULL) { in lockMonitor()
529 static bool tryLockMonitor(Thread* self, Monitor* mon) in tryLockMonitor() argument
531 if (mon->owner == self) { in tryLockMonitor()
536 mon->owner = self; in tryLockMonitor()
552 static bool unlockMonitor(Thread* self, Monitor* mon) in unlockMonitor() argument
554 assert(self != NULL); in unlockMonitor()
556 if (mon->owner == self) { in unlockMonitor()
730 static void waitMonitor(Thread* self, Monitor* mon, s8 msec, s4 nsec, in waitMonitor() argument
740 assert(self != NULL); in waitMonitor()
744 if (mon->owner != self) { in waitMonitor()
779 waitSetAppend(mon, self); in waitMonitor()
794 dvmChangeStatus(self, THREAD_TIMED_WAIT); in waitMonitor()
796 dvmChangeStatus(self, THREAD_WAIT); in waitMonitor()
798 dvmLockMutex(&self->waitMutex); in waitMonitor()
805 assert(self->waitMonitor == NULL); in waitMonitor()
806 self->waitMonitor = mon; in waitMonitor()
812 if (self->interrupted) { in waitMonitor()
814 self->waitMonitor = NULL; in waitMonitor()
815 dvmUnlockMutex(&self->waitMutex); in waitMonitor()
826 ret = pthread_cond_wait(&self->waitCond, &self->waitMutex); in waitMonitor()
830 ret = pthread_cond_timedwait_monotonic(&self->waitCond, &self->waitMutex, &ts); in waitMonitor()
832 ret = pthread_cond_timedwait(&self->waitCond, &self->waitMutex, &ts); in waitMonitor()
836 if (self->interrupted) { in waitMonitor()
840 self->interrupted = false; in waitMonitor()
841 self->waitMonitor = NULL; in waitMonitor()
843 dvmUnlockMutex(&self->waitMutex); in waitMonitor()
846 lockMonitor(self, mon); in waitMonitor()
855 mon->owner = self; in waitMonitor()
859 waitSetRemove(mon, self); in waitMonitor()
862 dvmChangeStatus(self, THREAD_RUNNING); in waitMonitor()
872 self->interrupted = false; in waitMonitor()
881 static void notifyMonitor(Thread* self, Monitor* mon) in notifyMonitor() argument
885 assert(self != NULL); in notifyMonitor()
889 if (mon->owner != self) { in notifyMonitor()
913 static void notifyAllMonitor(Thread* self, Monitor* mon) in notifyAllMonitor() argument
917 assert(self != NULL); in notifyAllMonitor()
921 if (mon->owner != self) { in notifyAllMonitor()
944 static void inflateMonitor(Thread *self, Object *obj) in inflateMonitor() argument
949 assert(self != NULL); in inflateMonitor()
952 assert(LW_LOCK_OWNER(obj->lock) == self->threadId); in inflateMonitor()
955 lockMonitor(self, mon); in inflateMonitor()
971 void dvmLockObject(Thread* self, Object *obj) in dvmLockObject() argument
979 assert(self != NULL); in dvmLockObject()
981 threadId = self->threadId; in dvmLockObject()
1002 inflateMonitor(self, obj); in dvmLockObject()
1026 oldStatus = dvmChangeStatus(self, THREAD_MONITOR); in dvmLockObject()
1076 dvmChangeStatus(self, oldStatus); in dvmLockObject()
1086 dvmChangeStatus(self, oldStatus); in dvmLockObject()
1090 inflateMonitor(self, obj); in dvmLockObject()
1098 lockMonitor(self, LW_MONITOR(obj->lock)); in dvmLockObject()
1118 if (self->status != THREAD_RUNNING) { in dvmLockObject()
1119 LOGE("Bad thread status (%d) in DP\n", self->status); in dvmLockObject()
1120 dvmDumpThread(self, false); in dvmLockObject()
1123 assert(!dvmCheckException(self)); in dvmLockObject()
1124 updateDeadlockPrediction(self, obj); in dvmLockObject()
1125 if (dvmCheckException(self)) { in dvmLockObject()
1131 dvmAddToMonitorList(self, obj, false); in dvmLockObject()
1132 dvmUnlockObject(self, obj); in dvmLockObject()
1134 dvmGetException(self)->clazz->descriptor); in dvmLockObject()
1143 dvmAddToMonitorList(self, obj, gDvm.deadlockPredictMode != kDPOff); in dvmLockObject()
1148 dvmAddToMonitorList(self, obj, false); in dvmLockObject()
1157 bool dvmUnlockObject(Thread* self, Object *obj) in dvmUnlockObject() argument
1161 assert(self != NULL); in dvmUnlockObject()
1162 assert(self->status == THREAD_RUNNING); in dvmUnlockObject()
1174 if (LW_LOCK_OWNER(thin) == self->threadId) { in dvmUnlockObject()
1208 if (!unlockMonitor(self, LW_MONITOR(obj->lock))) { in dvmUnlockObject()
1220 dvmRemoveFromMonitorList(self, obj); in dvmUnlockObject()
1229 void dvmObjectWait(Thread* self, Object *obj, s8 msec, s4 nsec, in dvmObjectWait() argument
1240 if (LW_LOCK_OWNER(thin) != self->threadId) { in dvmObjectWait()
1251 inflateMonitor(self, obj); in dvmObjectWait()
1253 self->threadId, &obj->lock, mon->lockCount); in dvmObjectWait()
1256 waitMonitor(self, mon, msec, nsec, interruptShouldThrow); in dvmObjectWait()
1262 void dvmObjectNotify(Thread* self, Object *obj) in dvmObjectNotify() argument
1272 if (LW_LOCK_OWNER(thin) != self->threadId) { in dvmObjectNotify()
1283 notifyMonitor(self, LW_MONITOR(thin)); in dvmObjectNotify()
1290 void dvmObjectNotifyAll(Thread* self, Object *obj) in dvmObjectNotifyAll() argument
1300 if (LW_LOCK_OWNER(thin) != self->threadId) { in dvmObjectNotifyAll()
1311 notifyAllMonitor(self, LW_MONITOR(thin)); in dvmObjectNotifyAll()
1331 Thread* self = dvmThreadSelf(); in dvmThreadSleep() local
1338 lockMonitor(self, mon); in dvmThreadSleep()
1339 waitMonitor(self, mon, msec, nsec, true); in dvmThreadSleep()
1340 unlockMonitor(self, mon); in dvmThreadSleep()
1393 Thread *self, *thread; in dvmIdentityHashCode() local
1433 self = dvmThreadSelf(); in dvmIdentityHashCode()
1434 if (self->threadId == lockOwner(obj)) { in dvmIdentityHashCode()
1464 if (tryLockMonitor(self, LW_MONITOR(*lw))) { in dvmIdentityHashCode()
1471 unlockMonitor(self, LW_MONITOR(*lw)); in dvmIdentityHashCode()
1479 dvmLockThreadList(self); in dvmIdentityHashCode()
1490 assert(owner != self->threadId); in dvmIdentityHashCode()
1821 static void logHeldMonitors(Thread* self) in logHeldMonitors() argument
1825 name = dvmGetThreadName(self); in logHeldMonitors()
1827 self->threadId, name); in logHeldMonitors()
1831 LockedObjectData* lod = self->pLockedObjects; in logHeldMonitors()
1848 static bool traverseTree(Thread* self, const Object* obj) in traverseTree() argument
1864 rawStackTrace = dvmFillInStackTraceRaw(self, &stackDepth); in traverseTree()
1869 logHeldMonitors(self); in traverseTree()
1898 if (!traverseTree(self, child)) { in traverseTree()
1925 static void updateDeadlockPrediction(Thread* self, Object* acqObj) in updateDeadlockPrediction() argument
1933 lod = dvmFindInMonitorList(self, acqObj); in updateDeadlockPrediction()
1953 inflateMonitor(self, acqObj); in updateDeadlockPrediction()
1959 mon->historyRawStackTrace = dvmFillInStackTraceRaw(self, in updateDeadlockPrediction()
1970 mrl = self->pLockedObjects; in updateDeadlockPrediction()
1997 inflateMonitor(self, mrl->obj); in updateDeadlockPrediction()
2022 if (!traverseTree(self, acqObj)) { in updateDeadlockPrediction()