Skip to content

Commit

Permalink
Merge pull request #284 from ibmruntimes/openj9
Browse files Browse the repository at this point in the history
Merge "Add NotCheckpointSafe annotations to PhantomCleanable" to 0.43
  • Loading branch information
JasonFengJ9 authored Nov 28, 2023
2 parents bf5bcad + 7b49cd4 commit 6874a7a
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 6874a7a

Please sign in to comment.