Skip to content

Commit

Permalink
Redefine 'BaseThread' to 'HotspotBaseThread' in hotspot. Change SA (s…
Browse files Browse the repository at this point in the history
…erviceability agent) to use 'HotspotBaseThread' correspondingly.
  • Loading branch information
jianglizhou committed Aug 17, 2023
1 parent 387af38 commit 5c1d7cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/threadLocalStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define SHARE_RUNTIME_THREADLOCALSTORAGE_HPP

#include "memory/allStatic.hpp"
#include "utilities/globalDefinitions.hpp"

// forward-decl as we can't have an include cycle
class Thread;
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/utilities/globalDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,10 @@ enum JavaThreadState {
_thread_max_state = 12 // maximum thread state+1 - used for statistics allocation
};

// Redefine Thread as BaseThread to avoid duplicate symbol issues for
// JDK static builds. See runtime/thread.hpp for Thread class.
#define Thread HotspotBaseThread

enum LockingMode {
// Use only heavy monitors for locking
LM_MONITOR = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void update(Observable o, Object data) {
}

private static synchronized void initialize(TypeDataBase db) {
Type typeThread = db.lookupType("Thread");
Type typeThread = db.lookupType("HotspotBaseThread");
Type typeJavaThread = db.lookupType("JavaThread");

suspendFlagsField = typeJavaThread.getCIntegerField("_suspend_flags");
Expand Down

0 comments on commit 5c1d7cd

Please sign in to comment.