Skip to content

Commit

Permalink
Initialize exclusive stats in safepoint exclusive
Browse files Browse the repository at this point in the history
Set a valid default requestor and lastResponder in the exclusive stats
when acquiring safepoint exclusive.

Fixes: #18260

Signed-off-by: Graham Chapman <[email protected]>
  • Loading branch information
gacholio committed Oct 20, 2023
1 parent b1abbfd commit 1095e93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/vm/VMAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ acquireSafePointVMAccess(J9VMThread * vmThread)
/* Grant safe point access to the thread now */
vm->safePointState = J9_XACCESS_PENDING;
vm->safePointResponseCount = 0;
initializeExclusiveVMAccessStats(vm, vmThread);
omrthread_monitor_exit(vm->exclusiveAccessMutex);

/* Post a safe point request to all threads */
Expand Down Expand Up @@ -1256,6 +1257,9 @@ releaseSafePointVMAccess(J9VMThread * vmThread)

omrthread_monitor_enter(vm->exclusiveAccessMutex);
vm->safePointState = J9_XACCESS_NONE;
/* Make sure stale thread pointers don't exist in the stats */
vm->omrVM->exclusiveVMAccessStats.requester = NULL;
vm->omrVM->exclusiveVMAccessStats.lastResponder = NULL;
omrthread_monitor_notify_all(vm->exclusiveAccessMutex);
omrthread_monitor_exit(vm->exclusiveAccessMutex);
omrthread_monitor_exit(vm->vmThreadListMutex);
Expand Down

0 comments on commit 1095e93

Please sign in to comment.