d47c8388aa
Processor thread might end up entering a safepoint while holding the processor's monitor which will make thread calling Cleanup deadlock while trying to acquire the monitor. Use SafepointMonitorLocker instead to avoid this. Startup is unlikely to exhibit this situation but we change it as well for symmetry. TEST=manually, as reliably hitting this is hard Change-Id: Ifb88a0418be064450374503bfc485e576a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467801 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Slava Egorov <vegorov@google.com>