Remove the useless "suspend count already zero" message for new threads.
We can actually detect the expected case of this warning ourselves, and
not emit it. Then we can upgrade the WARNING to a FATAL.
I also tripped over the fact that the operator<< for Thread::State was out
of date, so I've moved the Thread enums up to namespace scope so the script
can automatically generate correct operator<< implementations for us. (All
the high-numbered thread states have been off by one for a couple of weeks.)
Change-Id: I5de573d33d641e5a3cba87b370e9620c8c66e633
diff --git a/src/compiler.cc b/src/compiler.cc
index bac39ef..3980bac 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -943,10 +943,10 @@
if (worker->spawn_) {
runtime->AttachCurrentThread("Compiler Worker", true, NULL);
}
- Thread::Current()->SetState(Thread::kRunnable);
+ Thread::Current()->SetState(kRunnable);
worker->Run();
if (worker->spawn_) {
- Thread::Current()->SetState(Thread::kNative);
+ Thread::Current()->SetState(kNative);
runtime->DetachCurrentThread();
}
return NULL;
@@ -988,7 +988,7 @@
threads[0]->Go();
// Switch to kVmWait while we're blocked waiting for the other threads to finish.
- ScopedThreadStateChange tsc(self, Thread::kVmWait);
+ ScopedThreadStateChange tsc(self, kVmWait);
STLDeleteElements(&threads);
}