diff options
Diffstat (limited to 'vm/Thread.c')
-rw-r--r-- | vm/Thread.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vm/Thread.c b/vm/Thread.c index cd9b9d32c..36c34f41a 100644 --- a/vm/Thread.c +++ b/vm/Thread.c @@ -243,14 +243,18 @@ static void waitForThreadSuspend(Thread* self, Thread* thread); static int getThreadPriorityFromSystem(void); /* - * The JIT needs to know if any thread is suspended. We do this by - * maintaining a global sum of all threads' suspend counts. All suspendCount - * updates should go through this after aquiring threadSuspendCountLock. + * If there is any thread suspend request outstanding, + * we need to mark it in interpState to signal the interpreter that + * something is pending. We do this by maintaining a global sum of + * all threads' suspend counts. All suspendCount updates should go + * through this after aquiring threadSuspendCountLock. */ -static inline void dvmAddToThreadSuspendCount(int *pSuspendCount, int delta) +static void dvmAddToThreadSuspendCount(int *pSuspendCount, int delta) { *pSuspendCount += delta; gDvm.sumThreadSuspendCount += delta; + dvmUpdateInterpBreak(kSubModeSuspendRequest, + (gDvm.sumThreadSuspendCount != 0)); } /* @@ -1797,12 +1801,10 @@ static void threadExitUncaughtException(Thread* self, Object* group) } bail: -#if defined(WITH_JIT) /* Remove this thread's suspendCount from global suspendCount sum */ lockThreadSuspendCount(); dvmAddToThreadSuspendCount(&self->suspendCount, -self->suspendCount); unlockThreadSuspendCount(); -#endif dvmReleaseTrackedAlloc(exception, self); } |