From 5895ca772ab4aa51b29dbee9e4cf478c0c71ccab Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Wed, 10 Jun 2026 20:01:03 +0000 Subject: [PATCH] Add assert to windows SuspendedThreadTask::internal_do_task --- src/hotspot/os/windows/os_windows.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index d00babef40f..2b74cccb072 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -6058,6 +6058,11 @@ static inline HANDLE get_thread_handle_for_extended_context(DWORD tid) { // Thread sampling implementation // void SuspendedThreadTask::internal_do_task() { +#if INCLUDE_JFR + assert(NOT_COMPILER2(true) COMPILER2_PRESENT(!HotCodeHeap) || + SuspendedThreadTask_lock->owned_by_self(), + "suspend/resume must be serialized when HotCodeHeap is enabled"); +#endif const HANDLE h = get_thread_handle_for_extended_context(_thread->osthread()->thread_id()); if (h == nullptr) { return;