8278585: Drop unused code from OSThread

Reviewed-by: dholmes, tschatzl
This commit is contained in:
Thomas Stuefe 2021-12-14 05:45:56 +00:00
parent 8401a059bd
commit 3f9638d124
12 changed files with 13 additions and 57 deletions

View File

@ -63,13 +63,6 @@
// Used for debugging, return a unique integer for each thread.
int thread_identifier() const { return _thread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
tid_t kernel_thread_id() const {
return _kernel_thread_id;
}

View File

@ -741,7 +741,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == NULL, "caller responsible");
// Allocate the OSThread object.
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;
}
@ -855,7 +855,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;

View File

@ -67,14 +67,6 @@
intptr_t thread_identifier() const { return (intptr_t)_pthread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
pthread_t pthread_id() const {
return _pthread_id;
}

View File

@ -589,7 +589,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == NULL, "caller responsible");
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;
}
@ -682,7 +682,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;

View File

@ -55,13 +55,7 @@
// Used for debugging, return a unique integer for each thread.
int thread_identifier() const { return _thread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one.
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
pthread_t pthread_id() const {
return _pthread_id;
}

View File

@ -786,7 +786,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == NULL, "caller responsible");
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;
}
@ -915,7 +915,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;

View File

@ -49,13 +49,6 @@
// Used for debugging, return a unique integer for each thread.
int thread_identifier() const { return _thread_id; }
#endif
#ifdef ASSERT
// We expect no reposition failures so kill vm if we get one
//
bool valid_reposition_failure() {
return false;
}
#endif // ASSERT
private:
void pd_initialize();

View File

@ -568,7 +568,7 @@ static unsigned __stdcall thread_native_entry(Thread* thread) {
static OSThread* create_os_thread(Thread* thread, HANDLE thread_handle,
int thread_id) {
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) return NULL;
// Initialize the JDK library's interrupt event.
@ -671,7 +671,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
unsigned thread_id;
// Allocate the OSThread object
OSThread* osthread = new OSThread(NULL, NULL);
OSThread* osthread = new OSThread();
if (osthread == NULL) {
return false;
}

View File

@ -45,7 +45,6 @@ static int start_pos_address_offset = invalid_offset;
static int current_pos_offset = invalid_offset;
static int max_pos_offset = invalid_offset;
static int notified_offset = invalid_offset;
static int thread_id_offset = invalid_offset;
static int valid_offset = invalid_offset;
static bool find_field(InstanceKlass* ik,

View File

@ -26,10 +26,8 @@
#include "oops/oop.inline.hpp"
#include "runtime/osThread.hpp"
OSThread::OSThread(OSThreadStartFunc start_proc, void* start_parm) {
OSThread::OSThread() {
pd_initialize();
set_start_proc(start_proc);
set_start_parm(start_parm);
}
OSThread::~OSThread() {

View File

@ -61,8 +61,6 @@ class OSThread: public CHeapObj<mtThread> {
friend class VMStructs;
friend class JVMCIVMStructs;
private:
OSThreadStartFunc _start_proc; // Thread start routine
void* _start_parm; // Thread start routine parameter
volatile ThreadState _state; // Thread state *hint*
// Methods
@ -70,18 +68,9 @@ class OSThread: public CHeapObj<mtThread> {
void set_state(ThreadState state) { _state = state; }
ThreadState get_state() { return _state; }
OSThread(OSThreadStartFunc start_proc, void* start_parm);
OSThread();
~OSThread();
// Accessors
OSThreadStartFunc start_proc() const { return _start_proc; }
void set_start_proc(OSThreadStartFunc start_proc) { _start_proc = start_proc; }
void* start_parm() const { return _start_parm; }
void set_start_parm(void* start_parm) { _start_parm = start_parm; }
// This is specialized on Windows.
#ifndef _WINDOWS
void set_interrupted(bool z) { /* nothing to do */ }
#endif
// Printing
void print_on(outputStream* st) const;
void print() const;
@ -90,8 +79,6 @@ class OSThread: public CHeapObj<mtThread> {
#include OS_HEADER(osThread)
public:
static ByteSize thread_id_offset() { return byte_offset_of(OSThread, _thread_id); }
static size_t thread_id_size() { return sizeof(thread_id_t); }
thread_id_t thread_id() const { return _thread_id; }

View File

@ -1111,7 +1111,7 @@ void JavaThread::interrupt() {
debug_only(check_for_dangling_thread_pointer(this);)
// For Windows _interrupt_event
osthread()->set_interrupted(true);
WINDOWS_ONLY(osthread()->set_interrupted(true);)
// For Thread.sleep
_SleepEvent->unpark();
@ -1156,7 +1156,7 @@ bool JavaThread::is_interrupted(bool clear_interrupted) {
if (interrupted && clear_interrupted) {
assert(this == Thread::current(), "only the current thread can clear");
java_lang_Thread::set_interrupted(threadObj(), false);
osthread()->set_interrupted(false);
WINDOWS_ONLY(osthread()->set_interrupted(false);)
}
return interrupted;