equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
187 return sysPropsCache; |
187 return sysPropsCache; |
188 } |
188 } |
189 |
189 |
190 private synchronized JSList getThreads() { |
190 private synchronized JSList getThreads() { |
191 if (threadsCache == null) { |
191 if (threadsCache == null) { |
192 List threads = new ArrayList(0); |
192 List threadsList = new ArrayList(0); |
193 threadsCache = factory.newJSList(threads); |
193 threadsCache = factory.newJSList(threadsList); |
194 JavaThread jthread = vm.getThreads().first(); |
194 Threads threads = VM.getVM().getThreads(); |
195 while (jthread != null) { |
195 for (int i = 0; i < threads.getNumberOfThreads(); i++) { |
196 threads.add(jthread); |
196 JavaThread thread = threads.getJavaThreadAt(i); |
197 jthread = jthread.next(); |
197 threadsList.add(thread); |
198 } |
198 } |
199 } |
199 } |
200 return threadsCache; |
200 return threadsCache; |
201 } |
201 } |
202 |
202 |