• Home
  • Raw
  • Download

Lines Matching refs:self

242 static void waitForThreadSuspend(Thread* self, Thread* thread);
484 void dvmLockThreadList(Thread* self) in dvmLockThreadList() argument
488 if (self == NULL) /* try to get it from TLS */ in dvmLockThreadList()
489 self = dvmThreadSelf(); in dvmLockThreadList()
491 if (self != NULL) { in dvmLockThreadList()
492 oldStatus = self->status; in dvmLockThreadList()
493 self->status = THREAD_VMWAIT; in dvmLockThreadList()
502 if (self != NULL) in dvmLockThreadList()
503 self->status = oldStatus; in dvmLockThreadList()
554 Thread* self = dvmThreadSelf(); in lockThreadSuspend() local
556 if (!dvmCheckSuspendPending(self)) { in lockThreadSuspend()
578 self->threadId, who, getSuspendCauseStr(why)); in lockThreadSuspend()
590 self->threadId, who, getSuspendCauseStr(why)); in lockThreadSuspend()
631 Thread* self = dvmThreadSelf(); // may be null in dvmSlayDaemons() local
636 dvmLockThreadList(self); in dvmSlayDaemons()
638 if (self != NULL) in dvmSlayDaemons()
639 threadId = self->threadId; in dvmSlayDaemons()
643 if (target == self) { in dvmSlayDaemons()
690 dvmLockThreadList(self); in dvmSlayDaemons()
702 if (target == self) { in dvmSlayDaemons()
756 Thread* self; in dvmPrepMainForJni() local
759 self = gDvm.threadList; in dvmPrepMainForJni()
760 assert(self->threadId == kMainThreadId); in dvmPrepMainForJni()
763 if (!createFakeEntryFrame(self)) in dvmPrepMainForJni()
767 dvmSetJniEnvThreadId(pEnv, self); in dvmPrepMainForJni()
768 dvmSetThreadJNIEnv(self, (JNIEnv*) pEnv); in dvmPrepMainForJni()
1160 Thread* self = (Thread*) arg; in threadExitCheck() local
1161 assert(self != NULL); in threadExitCheck()
1164 self->threadId, arg, self->threadExitCheckCount); in threadExitCheck()
1166 if (self->status == THREAD_ZOMBIE) { in threadExitCheck()
1168 self->threadId); in threadExitCheck()
1172 if (self->threadExitCheckCount < kMaxCount) { in threadExitCheck()
1177 self->threadId, self->threadExitCheckCount); in threadExitCheck()
1178 self->threadExitCheckCount++; in threadExitCheck()
1179 int cc = pthread_setspecific(gDvm.pthreadKeySelf, self); in threadExitCheck()
1182 self->threadId); in threadExitCheck()
1187 self->threadId); in threadExitCheck()
1397 Thread* self; in dvmCreateInterpThread() local
1419 self = dvmThreadSelf(); in dvmCreateInterpThread()
1454 dvmLockThreadList(self); in dvmCreateInterpThread()
1479 ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT); in dvmCreateInterpThread()
1482 oldStatus = dvmChangeStatus(self, oldStatus); in dvmCreateInterpThread()
1578 dvmLockThreadList(self); in dvmCreateInterpThread()
1579 assert(self->status == THREAD_RUNNING); in dvmCreateInterpThread()
1580 self->status = THREAD_VMWAIT; in dvmCreateInterpThread()
1597 dvmChangeStatus(self, THREAD_RUNNING); in dvmCreateInterpThread()
1610 dvmLockThreadList(self); in dvmCreateInterpThread()
1632 Thread* self = (Thread*) arg; in interpThreadStart() local
1634 char *threadName = dvmGetThreadName(self); in interpThreadStart()
1641 dvmLockThreadList(self); in interpThreadStart()
1642 prepareThread(self); in interpThreadStart()
1644 LOG_THREAD("threadid=%d: created from interp\n", self->threadId); in interpThreadStart()
1650 self->status = THREAD_STARTING; in interpThreadStart()
1666 while (self->status != THREAD_VMWAIT) in interpThreadStart()
1674 self->jniEnv = dvmCreateJNIEnv(self); in interpThreadStart()
1680 dvmChangeStatus(self, THREAD_RUNNING); in interpThreadStart()
1687 dvmDbgPostThreadStart(self); in interpThreadStart()
1697 int priority = dvmGetFieldInt(self->threadObj, in interpThreadStart()
1699 dvmChangeThreadPriority(self, priority); in interpThreadStart()
1707 Method* run = self->threadObj->clazz->vtable[gDvm.voffJavaLangThread_run]; in interpThreadStart()
1710 LOGV("threadid=%d: calling run()\n", self->threadId); in interpThreadStart()
1712 dvmCallMethod(self, run, self->threadObj, &unused); in interpThreadStart()
1713 LOGV("threadid=%d: exiting\n", self->threadId); in interpThreadStart()
1734 static void threadExitUncaughtException(Thread* self, Object* group) in threadExitUncaughtException() argument
1742 self->threadId, group); in threadExitUncaughtException()
1749 exception = dvmGetException(self); in threadExitUncaughtException()
1750 dvmAddTrackedAlloc(exception, self); in threadExitUncaughtException()
1751 dvmClearException(self); in threadExitUncaughtException()
1763 handlerObj = dvmGetFieldObject(self->threadObj, threadHandler->byteOffset); in threadExitUncaughtException()
1777 dvmCallMethod(self, uncaughtHandler, handlerObj, &unused, in threadExitUncaughtException()
1778 self->threadObj, exception); in threadExitUncaughtException()
1783 dvmSetException(self, exception); in threadExitUncaughtException()
1791 dvmAddToThreadSuspendCount(&self->suspendCount, -self->suspendCount); in threadExitUncaughtException()
1794 dvmReleaseTrackedAlloc(exception, self); in threadExitUncaughtException()
1855 Thread* self = dvmThreadSelf(); in dvmCreateInternalThread() local
1856 ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT); in dvmCreateInternalThread()
1857 dvmLockThreadList(self); in dvmCreateInternalThread()
1866 dvmChangeStatus(self, oldStatus); in dvmCreateInternalThread()
1874 dvmChangeStatus(self, oldStatus); in dvmCreateInternalThread()
1946 Thread* self = NULL; in dvmAttachCurrentThread() local
1954 self = allocThread(gDvm.stackSize); in dvmAttachCurrentThread()
1955 if (self == NULL) in dvmAttachCurrentThread()
1957 setThreadSelf(self); in dvmAttachCurrentThread()
1964 dvmLockThreadList(self); in dvmAttachCurrentThread()
1965 ok = prepareThread(self); in dvmAttachCurrentThread()
1970 self->jniEnv = dvmCreateJNIEnv(self); in dvmAttachCurrentThread()
1971 if (self->jniEnv == NULL) in dvmAttachCurrentThread()
1980 if (!createFakeRunFrame(self)) in dvmAttachCurrentThread()
1987 LOG_THREAD("threadid=%d: adding to list (attached)\n", self->threadId); in dvmAttachCurrentThread()
1989 dvmLockThreadList(self); in dvmAttachCurrentThread()
1991 self->next = gDvm.threadList->next; in dvmAttachCurrentThread()
1992 if (self->next != NULL) in dvmAttachCurrentThread()
1993 self->next->prev = self; in dvmAttachCurrentThread()
1994 self->prev = gDvm.threadList; in dvmAttachCurrentThread()
1995 gDvm.threadList->next = self; in dvmAttachCurrentThread()
2015 assert(self->status == THREAD_INITIALIZING); in dvmAttachCurrentThread()
2016 dvmChangeStatus(self, THREAD_VMWAIT); in dvmAttachCurrentThread()
2019 dvmChangeStatus(self, THREAD_RUNNING); in dvmAttachCurrentThread()
2033 self->threadObj = threadObj; in dvmAttachCurrentThread()
2034 dvmSetFieldInt(vmThreadObj, gDvm.offJavaLangVMThread_vmData, (u4)self); in dvmAttachCurrentThread()
2050 assert(dvmCheckException(self)); in dvmAttachCurrentThread()
2066 dvmCallMethod(self, init, threadObj, &unused, (Object*)pArgs->group, in dvmAttachCurrentThread()
2068 if (dvmCheckException(self)) { in dvmAttachCurrentThread()
2110 dvmReleaseTrackedAlloc(threadObj, self); in dvmAttachCurrentThread()
2111 dvmReleaseTrackedAlloc(vmThreadObj, self); in dvmAttachCurrentThread()
2112 dvmReleaseTrackedAlloc((Object*)threadNameStr, self); in dvmAttachCurrentThread()
2115 self->threadId, pArgs->name); in dvmAttachCurrentThread()
2119 dvmDbgPostThreadStart(self); in dvmAttachCurrentThread()
2124 dvmLockThreadList(self); in dvmAttachCurrentThread()
2125 unlinkThread(self); in dvmAttachCurrentThread()
2131 dvmReleaseTrackedAlloc(threadObj, self); in dvmAttachCurrentThread()
2132 dvmReleaseTrackedAlloc(vmThreadObj, self); in dvmAttachCurrentThread()
2133 dvmReleaseTrackedAlloc((Object*)threadNameStr, self); in dvmAttachCurrentThread()
2134 if (self != NULL) { in dvmAttachCurrentThread()
2135 if (self->jniEnv != NULL) { in dvmAttachCurrentThread()
2136 dvmDestroyJNIEnv(self->jniEnv); in dvmAttachCurrentThread()
2137 self->jniEnv = NULL; in dvmAttachCurrentThread()
2139 freeThread(self); in dvmAttachCurrentThread()
2170 Thread* self = dvmThreadSelf(); in dvmDetachCurrentThread() local
2182 int curDepth = dvmComputeExactFrameDepth(self->curFrame); in dvmDetachCurrentThread()
2188 assert(!dvmIsBreakFrame(self->curFrame)); in dvmDetachCurrentThread()
2189 StackSaveArea* ssa = SAVEAREA_FROM_FP(self->curFrame); in dvmDetachCurrentThread()
2197 dvmDumpThread(self, false); in dvmDetachCurrentThread()
2202 group = dvmGetFieldObject(self->threadObj, gDvm.offJavaLangThread_group); in dvmDetachCurrentThread()
2203 LOG_THREAD("threadid=%d: detach (group=%p)\n", self->threadId, group); in dvmDetachCurrentThread()
2210 dvmReleaseJniMonitors(self); in dvmDetachCurrentThread()
2215 if (dvmCheckException(self)) in dvmDetachCurrentThread()
2216 threadExitUncaughtException(self, group); in dvmDetachCurrentThread()
2225 dvmCallMethod(self, removeThread, group, &unused, self->threadObj); in dvmDetachCurrentThread()
2234 vmThread = dvmGetFieldObject(self->threadObj, in dvmDetachCurrentThread()
2236 dvmAddTrackedAlloc(vmThread, self); in dvmDetachCurrentThread()
2237 dvmSetFieldObject(self->threadObj, gDvm.offJavaLangThread_vmThread, NULL); in dvmDetachCurrentThread()
2251 dvmDbgPostThreadDeath(self); in dvmDetachCurrentThread()
2257 dvmLockObject(self, vmThread); in dvmDetachCurrentThread()
2258 dvmObjectNotifyAll(self, vmThread); in dvmDetachCurrentThread()
2259 dvmUnlockObject(self, vmThread); in dvmDetachCurrentThread()
2261 dvmReleaseTrackedAlloc(vmThread, self); in dvmDetachCurrentThread()
2269 android_atomic_release_store(THREAD_VMWAIT, &self->status); in dvmDetachCurrentThread()
2288 self->threadId); in dvmDetachCurrentThread()
2296 dvmLockThreadList(self); in dvmDetachCurrentThread()
2301 dvmDestroyJNIEnv(self->jniEnv); in dvmDetachCurrentThread()
2302 self->jniEnv = NULL; in dvmDetachCurrentThread()
2304 self->status = THREAD_ZOMBIE; in dvmDetachCurrentThread()
2309 unlinkThread(self); in dvmDetachCurrentThread()
2315 if (!dvmGetFieldBoolean(self->threadObj, gDvm.offJavaLangThread_daemon)) { in dvmDetachCurrentThread()
2321 LOGV("threadid=%d: last non-daemon thread\n", self->threadId); in dvmDetachCurrentThread()
2329 LOGV("threadid=%d: bye!\n", self->threadId); in dvmDetachCurrentThread()
2330 releaseThreadId(self); in dvmDetachCurrentThread()
2335 freeThread(self); in dvmDetachCurrentThread()
2408 Thread* self = dvmThreadSelf(); in dvmSuspendSelf() local
2412 if (self->handle == dvmJdwpGetDebugThread(gDvm.jdwpState)) { in dvmSuspendSelf()
2423 dvmAddToThreadSuspendCount(&self->suspendCount, 1); in dvmSuspendSelf()
2424 self->dbgSuspendCount++; in dvmSuspendSelf()
2429 assert(self->suspendCount > 0); in dvmSuspendSelf()
2430 self->status = THREAD_SUSPENDED; in dvmSuspendSelf()
2431 LOG_THREAD("threadid=%d: self-suspending (dbg)\n", self->threadId); in dvmSuspendSelf()
2446 while (self->suspendCount != 0) { in dvmSuspendSelf()
2449 if (self->suspendCount != 0) { in dvmSuspendSelf()
2457 self->threadId, self->suspendCount, self->dbgSuspendCount); in dvmSuspendSelf()
2460 assert(self->suspendCount == 0 && self->dbgSuspendCount == 0); in dvmSuspendSelf()
2461 self->status = THREAD_RUNNING; in dvmSuspendSelf()
2463 self->threadId, self->status); in dvmSuspendSelf()
2626 static void waitForThreadSuspend(Thread* self, Thread* thread) in waitForThreadSuspend() argument
2679 self->threadId, retryCount, in waitForThreadSuspend()
2698 self->threadId, thread->threadId); in waitForThreadSuspend()
2710 self->threadId, in waitForThreadSuspend()
2744 Thread* self = dvmThreadSelf(); in dvmSuspendAllThreads() local
2758 LOG_THREAD("threadid=%d: SuspendAll starting\n", self->threadId); in dvmSuspendAllThreads()
2771 dvmLockThreadList(self); in dvmSuspendAllThreads()
2775 if (thread == self) in dvmSuspendAllThreads()
2804 if (thread == self) in dvmSuspendAllThreads()
2813 waitForThreadSuspend(self, thread); in dvmSuspendAllThreads()
2816 self->threadId, in dvmSuspendAllThreads()
2824 LOG_THREAD("threadid=%d: SuspendAll complete\n", self->threadId); in dvmSuspendAllThreads()
2834 Thread* self = dvmThreadSelf(); in dvmResumeAllThreads() local
2839 LOG_THREAD("threadid=%d: ResumeAll starting\n", self->threadId); in dvmResumeAllThreads()
2846 dvmLockThreadList(self); in dvmResumeAllThreads()
2849 if (thread == self) in dvmResumeAllThreads()
2905 LOG_THREAD("threadid=%d: ResumeAll waking others\n", self->threadId); in dvmResumeAllThreads()
2917 LOG_THREAD("threadid=%d: ResumeAll complete\n", self->threadId); in dvmResumeAllThreads()
2926 Thread* self = dvmThreadSelf(); in dvmUndoDebuggerSuspensions() local
2931 LOG_THREAD("threadid=%d: UndoDebuggerSusp starting\n", self->threadId); in dvmUndoDebuggerSuspensions()
2938 dvmLockThreadList(self); in dvmUndoDebuggerSuspensions()
2941 if (thread == self) in dvmUndoDebuggerSuspensions()
2969 LOG_THREAD("threadid=%d: UndoDebuggerSusp complete\n", self->threadId); in dvmUndoDebuggerSuspensions()
3018 Thread* self = dvmThreadSelf(); in dvmWaitForSuspend() local
3021 self->threadId, thread->threadId); in dvmWaitForSuspend()
3024 assert(thread != self); in dvmWaitForSuspend()
3025 assert(self->status != THREAD_RUNNING); in dvmWaitForSuspend()
3027 waitForThreadSuspend(self, thread); in dvmWaitForSuspend()
3030 self->threadId, thread->threadId); in dvmWaitForSuspend()
3039 static bool fullSuspendCheck(Thread* self) in fullSuspendCheck() argument
3041 assert(self != NULL); in fullSuspendCheck()
3042 assert(self->suspendCount >= 0); in fullSuspendCheck()
3050 bool needSuspend = (self->suspendCount != 0); in fullSuspendCheck()
3052 LOG_THREAD("threadid=%d: self-suspending\n", self->threadId); in fullSuspendCheck()
3053 ThreadStatus oldStatus = self->status; /* should be RUNNING */ in fullSuspendCheck()
3054 self->status = THREAD_SUSPENDED; in fullSuspendCheck()
3056 while (self->suspendCount != 0) { in fullSuspendCheck()
3065 assert(self->suspendCount == 0 && self->dbgSuspendCount == 0); in fullSuspendCheck()
3066 self->status = oldStatus; in fullSuspendCheck()
3068 self->threadId, self->status); in fullSuspendCheck()
3080 bool dvmCheckSuspendPending(Thread* self) in dvmCheckSuspendPending() argument
3082 assert(self != NULL); in dvmCheckSuspendPending()
3083 if (self->suspendCount == 0) { in dvmCheckSuspendPending()
3086 return fullSuspendCheck(self); in dvmCheckSuspendPending()
3097 ThreadStatus dvmChangeStatus(Thread* self, ThreadStatus newStatus) in dvmChangeStatus() argument
3101 if (self == NULL) in dvmChangeStatus()
3102 self = dvmThreadSelf(); in dvmChangeStatus()
3105 self->threadId, self->status, newStatus); in dvmChangeStatus()
3107 oldStatus = self->status; in dvmChangeStatus()
3161 android_atomic_acquire_store(newStatus, &self->status); in dvmChangeStatus()
3162 if (self->suspendCount != 0) { in dvmChangeStatus()
3163 fullSuspendCheck(self); in dvmChangeStatus()
3174 android_atomic_release_store(newStatus, &self->status); in dvmChangeStatus()
3766 static int getThreadObjectCount(const Thread* self) in getThreadObjectCount() argument
3771 lod = self->pLockedObjects; in getThreadObjectCount()
3788 void dvmAddToMonitorList(Thread* self, Object* obj, bool withTrace) in dvmAddToMonitorList() argument
3795 lod = self->pLockedObjects; in dvmAddToMonitorList()
3814 trace = dvmFillInStackTraceRaw(self, &depth); in dvmAddToMonitorList()
3819 newLod->next = self->pLockedObjects; in dvmAddToMonitorList()
3820 self->pLockedObjects = newLod; in dvmAddToMonitorList()
3823 self->threadId, newLod, getThreadObjectCount(self)); in dvmAddToMonitorList()
3830 void dvmRemoveFromMonitorList(Thread* self, Object* obj) in dvmRemoveFromMonitorList() argument
3835 lod = self->pLockedObjects; in dvmRemoveFromMonitorList()
3858 assert(self->pLockedObjects == lod); in dvmRemoveFromMonitorList()
3859 self->pLockedObjects = lod->next; in dvmRemoveFromMonitorList()
3866 self->threadId, lod, getThreadObjectCount(self)); in dvmRemoveFromMonitorList()
3875 LockedObjectData* dvmFindInMonitorList(const Thread* self, const Object* obj) in dvmFindInMonitorList() argument
3879 lod = self->pLockedObjects; in dvmFindInMonitorList()
4146 Thread* self = dvmThreadSelf(); in gcScanThread() local
4148 self->threadId, thread->threadId); in gcScanThread()
4151 dvmDumpThread(self, false); in gcScanThread()