*/
void dvmDumpMonitorInfo(const char* msg)
{
-#if QUIET_ZYGOTE_MONITOR
if (gDvm.zygote) {
return;
}
-#endif
int totalCount;
int liveCount;
len = strlen(procName);
cp = logWriteString(cp, procName, len);
- /* Emit the main thread status, 5 bytes. */
- bool isMainThread = (self->systemTid == getpid());
- cp = logWriteInt(cp, isMainThread);
+ /* Emit the sensitive thread ("main thread") status, 5 bytes. */
+ bool isSensitive = false;
+ if (gDvm.isSensitiveThreadHook != NULL) {
+ isSensitive = gDvm.isSensitiveThreadHook();
+ }
+ cp = logWriteInt(cp, isSensitive);
/* Emit self thread name string, <= 37 bytes. */
selfName = dvmGetThreadName(self);
/* Emit the lock owner source code file name, <= 37 bytes. */
if (ownerFileName == NULL) {
- ownerFileName = "";
+ ownerFileName = "";
} else if (strcmp(fileName, ownerFileName) == 0) {
- /* Common case, so save on log space. */
- ownerFileName = "-";
+ /* Common case, so save on log space. */
+ ownerFileName = "-";
}
cp = logWriteString(cp, ownerFileName, strlen(ownerFileName));
/*
* Converts the given relative waiting time into an absolute time.
*/
-void absoluteTime(s8 msec, s4 nsec, struct timespec *ts)
+static void absoluteTime(s8 msec, s4 nsec, struct timespec *ts)
{
s8 endSec;
* will have tried this before calling out to the VM.
*/
newThin = thin | (threadId << LW_LOCK_OWNER_SHIFT);
- if (android_atomic_release_cas(thin, newThin,
+ if (android_atomic_acquire_cas(thin, newThin,
(int32_t*)thinp) != 0) {
/*
* The acquire failed. Try again.
* owner field.
*/
newThin = thin | (threadId << LW_LOCK_OWNER_SHIFT);
- if (android_atomic_release_cas(thin, newThin,
+ if (android_atomic_acquire_cas(thin, newThin,
(int32_t *)thinp) == 0) {
/*
* The acquire succeed. Break out of the
* any other thread gets a chance.
*/
inflateMonitor(self, obj);
- LOG_THIN("(%d) lock %p fattened by wait() to count %d",
- self->threadId, &obj->lock, mon->lockCount);
+ LOG_THIN("(%d) lock %p fattened by wait()", self->threadId, &obj->lock);
}
mon = LW_MONITOR(obj->lock);
waitMonitor(self, mon, msec, nsec, interruptShouldThrow);
*/
lock = DVM_LOCK_INITIAL_THIN_VALUE;
lock |= (LW_HASH_STATE_HASHED << LW_HASH_STATE_SHIFT);
- if (android_atomic_release_cas(
+ if (android_atomic_acquire_cas(
(int32_t)DVM_LOCK_INITIAL_THIN_VALUE,
(int32_t)lock,
(int32_t *)lw) == 0) {