Skip to content

Commit b389bb4

Browse files
committedSep 5, 2024
8339540: Unify include requirements for PlatformMonitor/Mutex constructors/destructors
Reviewed-by: coleenp, sjohanss
1 parent ab656c3 commit b389bb4

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed
 

‎src/hotspot/os/windows/os_windows.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -5741,11 +5741,23 @@ void Parker::unpark() {
57415741
SetEvent(_ParkHandle);
57425742
}
57435743

5744+
// Platform Mutex/Monitor implementation
5745+
5746+
PlatformMutex::PlatformMutex() {
5747+
InitializeCriticalSection(&_mutex);
5748+
}
5749+
57445750
PlatformMutex::~PlatformMutex() {
57455751
DeleteCriticalSection(&_mutex);
57465752
}
57475753

5748-
// Platform Monitor implementation
5754+
PlatformMonitor::PlatformMonitor() {
5755+
InitializeConditionVariable(&_cond);
5756+
}
5757+
5758+
PlatformMonitor::~PlatformMonitor() {
5759+
// There is no DeleteConditionVariable API
5760+
}
57495761

57505762
// Must already be locked
57515763
int PlatformMonitor::wait(uint64_t millis) {

‎src/hotspot/os/windows/os_windows.inline.hpp

-12
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ inline bool os::numa_has_group_homing() { return false; }
6161

6262
// Platform Mutex/Monitor implementation
6363

64-
inline PlatformMutex::PlatformMutex() {
65-
InitializeCriticalSection(&_mutex);
66-
}
67-
68-
inline PlatformMonitor::PlatformMonitor() {
69-
InitializeConditionVariable(&_cond);
70-
}
71-
72-
inline PlatformMonitor::~PlatformMonitor() {
73-
// There is no DeleteConditionVariable API
74-
}
75-
7664
inline void PlatformMutex::lock() {
7765
EnterCriticalSection(&_mutex);
7866
}

0 commit comments

Comments
 (0)
Please sign in to comment.