From 0e01c8d3f3c2d7cc4ac2cf5cf01ae913a4c6181e Mon Sep 17 00:00:00 2001 From: Alex Light Date: Fri, 13 Dec 2019 14:26:09 -0800 Subject: Make sure all runtime threads are in the System thread group. We want to be sure that one can suspend every thread in the 'main' ThreadGroup without affecting the ability of the runtime to perform normal actions. Previously the jit thread-pool created threads in the 'main' thread group. Since some debugger actions can wait until all jit threads are in a known good state, pausing all threads in the main thread-group can cause deadlocks. To fix this we make the ThreadPool create all threads in the system thread-group. To test this we perform structural redefinition with all threads except the main one suspended. Previously this would deadlock if run with --jit, as we will pause the jit before performing redefinition. Test: ./test.py --host --jit Test: ./test.py --host Bug: 146178357 Change-Id: Ifcb0f29613d2fc22ca7913d4868a1e425b0bee5b --- .../src/Main.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/2005-pause-all-redefine-multithreaded/src/Main.java (limited to 'test/2005-pause-all-redefine-multithreaded/src/Main.java') diff --git a/test/2005-pause-all-redefine-multithreaded/src/Main.java b/test/2005-pause-all-redefine-multithreaded/src/Main.java new file mode 100644 index 0000000000..72cf037fcb --- /dev/null +++ b/test/2005-pause-all-redefine-multithreaded/src/Main.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class Main { + public static void main(String[] args) throws Exception { + art.Test2005.run(); + } +} -- cgit v1.2.3-59-g8ed1b