File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 4040#include " oops/oop.inline.hpp"
4141#include " runtime/java.hpp"
4242#include " runtime/nonJavaThread.hpp"
43+ #include " runtime/thread.inline.hpp"
4344
4445ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL ;
4546ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL ;
Original file line number Diff line number Diff line change @@ -106,11 +106,6 @@ class WorkerThread: public NamedThread {
106106 WorkerThread () : _id(0 ) { }
107107 virtual bool is_Worker_thread () const { return true ; }
108108
109- virtual WorkerThread* as_Worker_thread () const {
110- assert (is_Worker_thread (), " Dubious cast to WorkerThread*?" );
111- return (WorkerThread*) this ;
112- }
113-
114109 void set_id (uint work_id) { _id = work_id; }
115110 uint id () const { return _id; }
116111};
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ class Thread: public ThreadShadow {
355355 virtual bool is_active_Java_thread () const { return false ; }
356356
357357 // Casts
358- virtual WorkerThread* as_Worker_thread () const { return NULL ; }
358+ inline const WorkerThread* as_Worker_thread () const ;
359359 inline JavaThread* as_Java_thread ();
360360 inline const JavaThread* as_Java_thread () const ;
361361
Original file line number Diff line number Diff line change 3131#include " runtime/orderAccess.hpp"
3232#include " runtime/safepoint.hpp"
3333#include " runtime/thread.hpp"
34+ #include " runtime/nonJavaThread.hpp"
3435
3536#if defined(__APPLE__) && defined(AARCH64)
3637#include " runtime/os.hpp"
@@ -64,6 +65,11 @@ inline void Thread::set_threads_hazard_ptr(ThreadsList* new_list) {
6465 Atomic::release_store_fence (&_threads_hazard_ptr, new_list);
6566}
6667
68+ inline const WorkerThread* Thread::as_Worker_thread () const {
69+ assert (is_Worker_thread (), " incorrect cast to const WorkerThread" );
70+ return static_cast <const WorkerThread*>(this );
71+ }
72+
6773#if defined(__APPLE__) && defined(AARCH64)
6874inline void Thread::init_wx () {
6975 assert (this == Thread::current (), " should only be called for current thread" );
You can’t perform that action at this time.
0 commit comments