diff options
| author | 2019-12-13 14:26:09 -0800 | |
|---|---|---|
| committer | 2019-12-17 03:25:23 +0000 | |
| commit | 0e01c8d3f3c2d7cc4ac2cf5cf01ae913a4c6181e (patch) | |
| tree | 81d5237a7aed99844527163d4739a64a60a1f96d /test/2005-pause-all-redefine-multithreaded/src/Main.java | |
| parent | daad67f72f1d26fdb759326e504d540eab1e1392 (diff) | |
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
Diffstat (limited to 'test/2005-pause-all-redefine-multithreaded/src/Main.java')
| -rw-r--r-- | test/2005-pause-all-redefine-multithreaded/src/Main.java | 21 |
1 files changed, 21 insertions, 0 deletions
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(); + } +} |