Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/hotspot/share/runtime/continuationFreezeThaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ class Config {
using OopT = std::conditional_t<oops == oop_kind::NARROW, narrowOop, oop>;

static freeze_result freeze(JavaThread* thread, intptr_t* const sp) {
return freeze_internal<SelfT, false>(thread, sp);
freeze_result res = freeze_internal<SelfT, false>(thread, sp);
JFR_ONLY(assert((res == freeze_ok) || (res == thread->last_freeze_fail_result()), "freeze failure not set"));
return res;
}

static freeze_result freeze_preempt(JavaThread* thread, intptr_t* const sp) {
Expand Down Expand Up @@ -1722,6 +1724,9 @@ static inline freeze_result freeze_internal(JavaThread* current, intptr_t* const
log_develop_debug(continuations)("PINNED due to critical section/hold monitor");
verify_continuation(cont.continuation());
freeze_result res = entry->is_pinned() ? freeze_pinned_cs : freeze_pinned_monitor;
if (!preempt) {
JFR_ONLY(current->set_last_freeze_fail_result(res);)
}
log_develop_trace(continuations)("=== end of freeze (fail %d)", res);
// Avoid Thread.yield() loops without safepoint polls.
if (SafepointMechanism::should_process(current) && !preempt) {
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/runtime/javaThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ JavaThread::JavaThread(MemTag mem_tag) :

_SleepEvent(ParkEvent::Allocate(this)),

#if INCLUDE_JFR
_last_freeze_fail_result(freeze_ok),
#endif

_lock_stack(this),
_om_cache(this) {
set_jni_functions(jni_functions());
Expand Down Expand Up @@ -2361,4 +2365,4 @@ void JavaThread::post_vthread_pinned_event(EventVirtualThreadPinned* event, cons
event->commit();
}
}
#endif
#endif