Skip to content

Commit

Permalink
8339540: Unify include requirements for PlatformMonitor/Mutex constru…
Browse files Browse the repository at this point in the history
…ctors/destructors

Reviewed-by: coleenp, sjohanss
  • Loading branch information
stefank committed Sep 5, 2024
1 parent ab656c3 commit b389bb4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 13 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5741,11 +5741,23 @@ void Parker::unpark() {
SetEvent(_ParkHandle);
}

// Platform Mutex/Monitor implementation

PlatformMutex::PlatformMutex() {
InitializeCriticalSection(&_mutex);
}

PlatformMutex::~PlatformMutex() {
DeleteCriticalSection(&_mutex);
}

// Platform Monitor implementation
PlatformMonitor::PlatformMonitor() {
InitializeConditionVariable(&_cond);
}

PlatformMonitor::~PlatformMonitor() {
// There is no DeleteConditionVariable API
}

// Must already be locked
int PlatformMonitor::wait(uint64_t millis) {
Expand Down
12 changes: 0 additions & 12 deletions src/hotspot/os/windows/os_windows.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ inline bool os::numa_has_group_homing() { return false; }

// Platform Mutex/Monitor implementation

inline PlatformMutex::PlatformMutex() {
InitializeCriticalSection(&_mutex);
}

inline PlatformMonitor::PlatformMonitor() {
InitializeConditionVariable(&_cond);
}

inline PlatformMonitor::~PlatformMonitor() {
// There is no DeleteConditionVariable API
}

inline void PlatformMutex::lock() {
EnterCriticalSection(&_mutex);
}
Expand Down

0 comments on commit b389bb4

Please sign in to comment.