diff options
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 7ecfdc70cd..1465b14d44 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -869,22 +869,15 @@ bool Runtime::Start() { GetInstructionSetString(kRuntimeISA)); } - StartDaemonThreads(); - - // Make sure the environment is still clean (no lingering local refs from starting daemon - // threads). - { - ScopedObjectAccess soa(self); - self->GetJniEnv()->AssertLocalsEmpty(); - } - - // Send the initialized phase event. Send it after starting the Daemon threads so that agents - // cannot delay the daemon threads from starting forever. + // Send the initialized phase event. Send it before starting daemons, as otherwise + // sending thread events becomes complicated. { ScopedObjectAccess soa(self); callbacks_->NextRuntimePhase(RuntimePhaseCallback::RuntimePhase::kInit); } + StartDaemonThreads(); + { ScopedObjectAccess soa(self); self->GetJniEnv()->AssertLocalsEmpty(); |