< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page
rev 57079 : imported patch 8234796

@@ -1993,41 +1993,39 @@
 WB_END
 
 #endif // INCLUDE_CDS
 
 WB_ENTRY(jint, WB_HandshakeWalkStack(JNIEnv* env, jobject wb, jobject thread_handle, jboolean all_threads))
-  class TraceSelfClosure : public ThreadClosure {
+  class TraceSelfHandshake : public HandshakeOperation {
     jint _num_threads_completed;
 
-    void do_thread(Thread* th) {
-      assert(th->is_Java_thread(), "sanity");
-      JavaThread* jt = (JavaThread*)th;
+   public:
+    void do_thread(JavaThread* jt) {
       ResourceMark rm;
 
       jt->print_on(tty);
       jt->print_stack_on(tty);
       tty->cr();
       Atomic::inc(&_num_threads_completed);
     }
 
-  public:
-    TraceSelfClosure() : _num_threads_completed(0) {}
+    TraceSelfHandshake() : HandshakeOperation("WB_TraceSelf"), _num_threads_completed(0) {}
 
     jint num_threads_completed() const { return _num_threads_completed; }
   };
-  TraceSelfClosure tsc;
+  TraceSelfHandshake ts_hs;
 
   if (all_threads) {
-    Handshake::execute(&tsc);
+    Handshake::execute(&ts_hs);
   } else {
     oop thread_oop = JNIHandles::resolve(thread_handle);
     if (thread_oop != NULL) {
       JavaThread* target = java_lang_Thread::thread(thread_oop);
-      Handshake::execute(&tsc, target);
+      Handshake::execute(&ts_hs, target);
     }
   }
-  return tsc.num_threads_completed();
+  return ts_hs.num_threads_completed();
 WB_END
 
 //Some convenience methods to deal with objects from java
 int WhiteBox::offset_for_field(const char* field_name, oop object,
     Symbol* signature_symbol) {
< prev index next >