Skip to content

Commit

Permalink
8341513: Remove the unused thread_type field from OSThread
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, dholmes
  • Loading branch information
offamitkumar committed Oct 18, 2024
1 parent 7a16906 commit f50bd0d
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 42 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/os/aix/osThread_aix.cpp
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -32,7 +32,6 @@

OSThread::OSThread()
: _thread_id(0),
_thread_type(),
_kernel_thread_id(0),
_caller_sigmask(),
sr(),
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/os/aix/osThread_aix.hpp
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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.
Expand All @@ -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; }
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/os/aix/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os/bsd/osThread_bsd.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,7 +37,6 @@ OSThread::OSThread()
nullptr
#endif
),
_thread_type(),
_pthread_id(nullptr),
_unique_thread_id(0),
_caller_sigmask(),
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/os/bsd/osThread_bsd.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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).
Expand All @@ -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; }
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/os/bsd/os_bsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os/linux/osThread_linux.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,7 +31,6 @@

OSThread::OSThread()
: _thread_id(0),
_thread_type(),
_pthread_id(0),
_caller_sigmask(),
sr(),
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/os/linux/osThread_linux.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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).
Expand All @@ -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; }
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

1 comment on commit f50bd0d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.