211 |
211 |
212 ThreadStackTrace* _stack_trace; |
212 ThreadStackTrace* _stack_trace; |
213 ThreadConcurrentLocks* _concurrent_locks; |
213 ThreadConcurrentLocks* _concurrent_locks; |
214 ThreadSnapshot* _next; |
214 ThreadSnapshot* _next; |
215 |
215 |
216 public: |
216 // ThreadSnapshot instances should only be created via |
217 // Dummy snapshot |
217 // ThreadDumpResult::add_thread_snapshot. |
|
218 friend class ThreadDumpResult; |
218 ThreadSnapshot() : _thread(NULL), _threadObj(NULL), |
219 ThreadSnapshot() : _thread(NULL), _threadObj(NULL), |
219 _blocker_object(NULL), _blocker_object_owner(NULL), |
220 _blocker_object(NULL), _blocker_object_owner(NULL), |
220 _stack_trace(NULL), _concurrent_locks(NULL), _next(NULL) {}; |
221 _stack_trace(NULL), _concurrent_locks(NULL), _next(NULL) {}; |
221 ThreadSnapshot(ThreadsList * t_list, JavaThread* thread); |
222 void initialize(ThreadsList * t_list, JavaThread* thread); |
|
223 |
|
224 public: |
222 ~ThreadSnapshot(); |
225 ~ThreadSnapshot(); |
223 |
226 |
224 java_lang_Thread::ThreadStatus thread_status() { return _thread_status; } |
227 java_lang_Thread::ThreadStatus thread_status() { return _thread_status; } |
225 |
228 |
226 oop threadObj() const { return _threadObj; } |
229 oop threadObj() const { return _threadObj; } |
365 ThreadSnapshot* _last; |
368 ThreadSnapshot* _last; |
366 ThreadDumpResult* _next; |
369 ThreadDumpResult* _next; |
367 ThreadsListSetter _setter; // Helper to set hazard ptr in the originating thread |
370 ThreadsListSetter _setter; // Helper to set hazard ptr in the originating thread |
368 // which protects the JavaThreads in _snapshots. |
371 // which protects the JavaThreads in _snapshots. |
369 |
372 |
|
373 void link_thread_snapshot(ThreadSnapshot* ts); |
|
374 |
370 public: |
375 public: |
371 ThreadDumpResult(); |
376 ThreadDumpResult(); |
372 ThreadDumpResult(int num_threads); |
377 ThreadDumpResult(int num_threads); |
373 ~ThreadDumpResult(); |
378 ~ThreadDumpResult(); |
374 |
379 |
375 void add_thread_snapshot(ThreadSnapshot* ts); |
380 ThreadSnapshot* add_thread_snapshot(); |
|
381 ThreadSnapshot* add_thread_snapshot(JavaThread* thread); |
|
382 |
376 void set_next(ThreadDumpResult* next) { _next = next; } |
383 void set_next(ThreadDumpResult* next) { _next = next; } |
377 ThreadDumpResult* next() { return _next; } |
384 ThreadDumpResult* next() { return _next; } |
378 int num_threads() { return _num_threads; } |
385 int num_threads() { return _num_threads; } |
379 int num_snapshots() { return _num_snapshots; } |
386 int num_snapshots() { return _num_snapshots; } |
380 ThreadSnapshot* snapshots() { return _snapshots; } |
387 ThreadSnapshot* snapshots() { return _snapshots; } |