From f50bd0d9ec65a6b9596805d0131aaefc1bb913f3 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 18 Oct 2024 03:37:50 +0000 Subject: [PATCH] 8341513: Remove the unused thread_type field from OSThread Reviewed-by: stefank, dholmes --- src/hotspot/os/aix/osThread_aix.cpp | 3 +-- src/hotspot/os/aix/osThread_aix.hpp | 10 +--------- src/hotspot/os/aix/os_aix.cpp | 3 --- src/hotspot/os/bsd/osThread_bsd.cpp | 3 +-- src/hotspot/os/bsd/osThread_bsd.hpp | 10 +--------- src/hotspot/os/bsd/os_bsd.cpp | 3 --- src/hotspot/os/linux/osThread_linux.cpp | 3 +-- src/hotspot/os/linux/osThread_linux.hpp | 10 +--------- src/hotspot/os/linux/os_linux.cpp | 3 --- 9 files changed, 6 insertions(+), 42 deletions(-) diff --git a/src/hotspot/os/aix/osThread_aix.cpp b/src/hotspot/os/aix/osThread_aix.cpp index ab08a766156..c424b044c09 100644 --- a/src/hotspot/os/aix/osThread_aix.cpp +++ b/src/hotspot/os/aix/osThread_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -32,7 +32,6 @@ OSThread::OSThread() : _thread_id(0), - _thread_type(), _kernel_thread_id(0), _caller_sigmask(), sr(), diff --git a/src/hotspot/os/aix/osThread_aix.hpp b/src/hotspot/os/aix/osThread_aix.hpp index 8f3799d0701..514e554101e 100644 --- a/src/hotspot/os/aix/osThread_aix.hpp +++ b/src/hotspot/os/aix/osThread_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2013 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -36,7 +36,6 @@ class OSThread : public OSThreadBase { typedef pthread_t thread_id_t; thread_id_t _thread_id; - int _thread_type; // On AIX, we use the pthread id as OSThread::thread_id and keep the kernel thread id // separately for diagnostic purposes. @@ -52,13 +51,6 @@ class OSThread : public OSThreadBase { OSThread(); ~OSThread(); - int thread_type() const { - return _thread_type; - } - void set_thread_type(int type) { - _thread_type = type; - } - // Methods to save/restore caller's signal mask sigset_t caller_sigmask() const { return _caller_sigmask; } void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 5022272d1b4..842ab0c6eeb 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -698,9 +698,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, return false; } - // Set the correct thread state. - osthread->set_thread_type(thr_type); - // Initial state is ALLOCATED but not INITIALIZED osthread->set_state(ALLOCATED); diff --git a/src/hotspot/os/bsd/osThread_bsd.cpp b/src/hotspot/os/bsd/osThread_bsd.cpp index 4080ea1bf29..d9624040bc7 100644 --- a/src/hotspot/os/bsd/osThread_bsd.cpp +++ b/src/hotspot/os/bsd/osThread_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ OSThread::OSThread() nullptr #endif ), - _thread_type(), _pthread_id(nullptr), _unique_thread_id(0), _caller_sigmask(), diff --git a/src/hotspot/os/bsd/osThread_bsd.hpp b/src/hotspot/os/bsd/osThread_bsd.hpp index e54e7195f98..21bec3f3836 100644 --- a/src/hotspot/os/bsd/osThread_bsd.hpp +++ b/src/hotspot/os/bsd/osThread_bsd.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ class OSThread : public OSThreadBase { #endif thread_id_t _thread_id; - int _thread_type; // _pthread_id is the pthread id, which is used by library calls // (e.g. pthread_kill). @@ -56,13 +55,6 @@ class OSThread : public OSThreadBase { OSThread(); ~OSThread(); - int thread_type() const { - return _thread_type; - } - void set_thread_type(int type) { - _thread_type = type; - } - // Methods to save/restore caller's signal mask sigset_t caller_sigmask() const { return _caller_sigmask; } void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 6b3bf060d6f..b50ebf22203 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -633,9 +633,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, return false; } - // set the correct thread state - osthread->set_thread_type(thr_type); - // Initial state is ALLOCATED but not INITIALIZED osthread->set_state(ALLOCATED); diff --git a/src/hotspot/os/linux/osThread_linux.cpp b/src/hotspot/os/linux/osThread_linux.cpp index 3dd6e3bbcd1..c9a44eb413f 100644 --- a/src/hotspot/os/linux/osThread_linux.cpp +++ b/src/hotspot/os/linux/osThread_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ OSThread::OSThread() : _thread_id(0), - _thread_type(), _pthread_id(0), _caller_sigmask(), sr(), diff --git a/src/hotspot/os/linux/osThread_linux.hpp b/src/hotspot/os/linux/osThread_linux.hpp index f8dfd5a213b..5ed2d07850a 100644 --- a/src/hotspot/os/linux/osThread_linux.hpp +++ b/src/hotspot/os/linux/osThread_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,6 @@ class OSThread : public OSThreadBase { typedef pid_t thread_id_t; thread_id_t _thread_id; - int _thread_type; // _pthread_id is the pthread id, which is used by library calls // (e.g. pthread_kill). @@ -47,13 +46,6 @@ class OSThread : public OSThreadBase { OSThread(); ~OSThread(); - int thread_type() const { - return _thread_type; - } - void set_thread_type(int type) { - _thread_type = type; - } - // Methods to save/restore caller's signal mask sigset_t caller_sigmask() const { return _caller_sigmask; } void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 514268a7400..b2b9a798119 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -974,9 +974,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, return false; } - // set the correct thread state - osthread->set_thread_type(thr_type); - // Initial state is ALLOCATED but not INITIALIZED osthread->set_state(ALLOCATED);