File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed
visualvm/applicationviews/src/org/graalvm/visualvm/application/views/threads Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -260,23 +260,23 @@ public void actionPerformed(ActionEvent e) {
260
260
private void updateThreadsCounts (final VisualVMThreadsDataManager threadsManager ) {
261
261
262
262
final int [] threads = new int [2 ];
263
-
264
- getWorker ().post (new Runnable () {
265
- public void run () {
266
- try {
263
+ // TODO: needs a worker thread to read threadCount/daemonThreadCount?
264
+ // getWorker().post(new Runnable() {
265
+ // public void run() {
266
+ // try {
267
267
threads [0 ] = threadsManager .getThreadCount ();
268
268
threads [1 ] = threadsManager .getDaemonThreadCount ();
269
- } catch (Exception ex ) {
270
- threads [0 ] = 0 ;
271
- threads [1 ] = 0 ;
272
- }
269
+ // } catch (Exception ex) {
270
+ // threads[0] = 0;
271
+ // threads[1] = 0;
272
+ // }
273
273
SwingUtilities .invokeLater (new Runnable () {
274
274
public void run () {
275
275
updateThreadsCounts (threads [0 ], threads [1 ]);
276
276
}
277
277
});
278
- }
279
- });
278
+ // }
279
+ // });
280
280
}
281
281
282
282
private void setAlertText (String alert ) {
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ class ThreadMXBeanDataManager extends VisualVMThreadsDataManager {
56
56
private DeadlockDetector deadlockDetector ;
57
57
private PropertyChangeSupport changeSupport ;
58
58
private long [] deadlockThreadIds ;
59
+
60
+ private int threadCount , daemonThreadCount ;
61
+
59
62
60
63
ThreadMXBeanDataManager (ThreadMXBean tb ) {
61
64
threadBean = tb ;
@@ -90,6 +93,8 @@ void refreshThreadsSync() {
90
93
try {
91
94
ThreadMonitoredDataResponse resp = new ThreadMonitoredDataResponse ();
92
95
resp .fillInThreadData ();
96
+ threadCount = threadBean .getThreadCount ();
97
+ daemonThreadCount = threadBean .getDaemonThreadCount ();
93
98
final MonitoredData monitoredData = MonitoredData .getMonitoredData (resp );
94
99
SwingUtilities .invokeLater (new Runnable () {
95
100
@@ -104,11 +109,11 @@ public void run() {
104
109
}
105
110
106
111
int getDaemonThreadCount () {
107
- return threadBean . getDaemonThreadCount () ;
112
+ return daemonThreadCount ;
108
113
}
109
114
110
115
int getThreadCount () {
111
- return threadBean . getThreadCount () ;
116
+ return threadCount ;
112
117
}
113
118
114
119
void addPropertyChangeListener (PropertyChangeListener l ) {
You can’t perform that action at this time.
0 commit comments