Don't run thread callbacks for runtime threads and shutdown thread

libjdwp tests need an event handler lock to process any events. When
processing certain events like removing the last breakpoint we have to
update entrypoints of the methods while holding the event handler lock.
Deopt manager requires to enter GCCriticalSection when updating
entrypoints. This might prevent us from attaching any threads since
thread callbacks cannot finish. This is generally not an issue except
for heap worker threads and shutdown thread. In these cases we can
create a mutual wait:
DeoptManager blocked on ongoing GC while holding event handler lock
GC waiting on deoptmanager to release event handler lock to attach
threads.

This CL avoids calling thread callbacks for runtime threads (heap / JIT
worker threads) and shutdown thread. This is a temporary fix till we can
avoid using GCCriticalSection in deopt manager.

Bug: 251163712
Bug: 70838465
Test: ART_USE_READ_BARRIER=false run-libjdwp-test.py ObjectReference_DisableCollectionTest

Change-Id: I2f3cb7f0227f88924c299c7e983abb5dc253425d
(cherry picked from commit 798f53c10c095000ccad0b1b6fd4735fd6b30d1d)
Merged-In: I2f3cb7f0227f88924c299c7e983abb5dc253425d
8 files changed