summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2018-07-12 11:09:59 -0700
committerAlex Light <allight@google.com>2018-07-17 11:03:20 -0700
commit53570676750d74416cecdf5a8e01f3cf9a8d4169 (patch)
tree8de1c48dd0a83091ffef6bf321ffc4ffc05b1147 /compiler/optimizing/codegen_test_utils.h
parentb7f10d59557cb6b6cd6824f3bf4d77f961248846 (diff)
Allow threads to be marked as unsuspendable by kForUserCode
There was a possible deadlock between jit-threads being suspended and another thread waiting for the jit-thread to finish their work. If the jit-thread hit a suspend-point the process would deadlock. This fixes this by allowing threads to be marked as unsuspendable by user-code. This prevents the issue by marking jit and gc threads as unsuspendable by user code. Agents attempting to suspend them using JVMTI will succeed (and see the thread as suspended) but internal runtime methods will not see the thread as suspended and the thread will not be prevented from moving into the kRunnable state. A thread that is unsuspendable trying to suspend itself using JVMTI will get ERR(INTERNAL) and a log message. Doing this requires that we rewrite the JVMTI thread suspension code somewhat so it will now perform an unconditional kInternal suspension prior to trying to suspend the thread kForUserCode. The kInternal suspension is then lifted. This ensures that everything is done atomically even if the kForUserCode won't stop the thread. Test: ./test.py --host Test: ./art/tools/run-libjdwp-tests.sh --mode=host Test: ./art/tools/run-libjdwp-tests.sh \ --mode=host \ --variant=x64 \ --test org.apache.harmony.jpda.tests.jdwp.EventModifiers.InstanceOnlyModifierTest Bug: 70838465 Bug: 111348762 Change-Id: I91211641b82416664bf5abd8546efebf4f672f12
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
0 files changed, 0 insertions, 0 deletions