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/alloc/Heap.c b/vm/alloc/Heap.c
index cc3fd72..1f36601 100644
--- a/vm/alloc/Heap.c
+++ b/vm/alloc/Heap.c
@@ -166,16 +166,9 @@
ThreadStatus oldStatus;
self = dvmThreadSelf();
- if (self != NULL) {
- oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
- } else {
- LOGI("ODD: waiting on heap lock, no self\n");
- oldStatus = -1; // shut up gcc
- }
+ oldStatus = dvmChangeStatus(self, THREAD_VMWAIT);
dvmLockMutex(&gDvm.gcHeapLock);
- if (self != NULL) {
- dvmChangeStatus(self, oldStatus);
- }
+ dvmChangeStatus(self, oldStatus);
}
return true;