-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed missing case for putOrderedObject
- Loading branch information
1 parent
0a4a422
commit 3919742
Showing
3 changed files
with
50 additions
and
31 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/runtime/mask/SpecialAccessPolicy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package edu.columbia.cs.psl.phosphor.runtime.mask; | ||
|
||
public enum SpecialAccessPolicy { | ||
VOLATILE { | ||
@Override | ||
public void putObject(UnsafeAdapter unsafe, Object o, long offset, Object x) { | ||
unsafe.putObjectVolatile(o, offset, x); | ||
} | ||
|
||
@Override | ||
public Object getObject(UnsafeAdapter unsafe, Object o, long offset) { | ||
return unsafe.getObjectVolatile(o, offset); | ||
} | ||
}, | ||
ORDERED { | ||
@Override | ||
public void putObject(UnsafeAdapter unsafe, Object o, long offset, Object x) { | ||
unsafe.putOrderedObject(o, offset, x); | ||
} | ||
|
||
@Override | ||
public Object getObject(UnsafeAdapter unsafe, Object o, long offset) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
}, | ||
NONE { | ||
@Override | ||
public void putObject(UnsafeAdapter unsafe, Object o, long offset, Object x) { | ||
unsafe.putObject(o, offset, x); | ||
} | ||
|
||
@Override | ||
public Object getObject(UnsafeAdapter unsafe, Object o, long offset) { | ||
return unsafe.getObject(o, offset); | ||
} | ||
}; | ||
|
||
public abstract void putObject(UnsafeAdapter unsafe, Object o, long offset, Object x); | ||
|
||
public abstract Object getObject(UnsafeAdapter unsafe, Object o, long offset); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters