Minor clean-up of thread status changes.
Eliminate the obsolete self != NULL test when acquiring the heap lock.
This should be redundant now that threads are added to the thread list
before they are able to allocate.
Switch to using a variable of the ThreadStatus type to store thread
status values rather than an ordinary int.
Change-Id: I8d30e69f20d5321a04f6b49322f13b3577d5a3c4
diff --git a/vm/Thread.c b/vm/Thread.c
index 56cafb4..7dde87c 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -1465,9 +1465,8 @@
*/
dvmUnlockThreadList();
- int cc, oldStatus;
- oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
- cc = pthread_create(&threadHandle, &threadAttr, interpThreadStart,
+ ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
+ int cc = pthread_create(&threadHandle, &threadAttr, interpThreadStart,
newThread);
oldStatus = dvmChangeStatus(self, oldStatus);
@@ -1843,7 +1842,7 @@
* need to initiate a GC. We switch to VMWAIT while we pause.
*/
Thread* self = dvmThreadSelf();
- int oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
+ ThreadStatus oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
dvmLockThreadList(self);
while (createStatus == 0)
pthread_cond_wait(&gDvm.threadStartCond, &gDvm.threadListLock);