Skip to content

Commit

Permalink
Merge pull request #283 from singh264/openj9_issues_18399_and_18514
Browse files Browse the repository at this point in the history
Add NotCheckpointSafe annotations to PhantomCleanable
  • Loading branch information
tajila authored Nov 27, 2023
2 parents 67b9bcb + 09c3a13 commit 7b49cd4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions closed/GensrcJ9JCL.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ $(eval $(call SetupCopyFiles,COPY_OVERLAY_FILES, \
src/java.base/share/classes/java/util/TimerTask.java \
src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java \
src/java.base/share/classes/jdk/internal/access/JavaNetInetAddressAccess.java \
src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java \
src/java.base/share/classes/sun/security/jca/ProviderConfig.java \
src/java.base/share/classes/sun/security/jca/ProviderList.java \
src/java.base/unix/classes/java/lang/ProcessEnvironment.java \
Expand Down
18 changes: 18 additions & 0 deletions src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package jdk.internal.ref;

Expand All @@ -30,6 +35,10 @@
import java.lang.ref.PhantomReference;
import java.util.Objects;

/*[IF CRIU_SUPPORT]*/
import openj9.internal.criu.NotCheckpointSafe;
/*[ENDIF] CRIU_SUPPORT */

/**
* PhantomCleanable subclasses efficiently encapsulate cleanup state and
* the cleaning action.
Expand Down Expand Up @@ -83,6 +92,9 @@ public PhantomCleanable(T referent, Cleaner cleaner) {
/**
* Insert this PhantomCleanable after the list head.
*/
/*[IF CRIU_SUPPORT]*/
@NotCheckpointSafe
/*[ENDIF] CRIU_SUPPORT */
private void insert() {
synchronized (list) {
prev = list;
Expand All @@ -98,6 +110,9 @@ private void insert() {
* @return true if Cleanable was removed or false if not because
* it had already been removed before
*/
/*[IF CRIU_SUPPORT]*/
@NotCheckpointSafe
/*[ENDIF] CRIU_SUPPORT */
private boolean remove() {
synchronized (list) {
if (next != this) {
Expand All @@ -116,6 +131,9 @@ private boolean remove() {
*
* @return true if the list is empty
*/
/*[IF CRIU_SUPPORT]*/
@NotCheckpointSafe
/*[ENDIF] CRIU_SUPPORT */
boolean isListEmpty() {
synchronized (list) {
return list == list.next;
Expand Down

0 comments on commit 7b49cd4

Please sign in to comment.