unsafe-fences

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

com.headius
ArtifactId

ArtifactId

unsafe-fences
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

unsafe-fences
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/headius/unsafe-fences

Download unsafe-fences

How to add to project

<!-- https://jarcasting.com/artifacts/com.headius/unsafe-fences/ -->
<dependency>
    <groupId>com.headius</groupId>
    <artifactId>unsafe-fences</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.headius/unsafe-fences/
implementation 'com.headius:unsafe-fences:1.0'
// https://jarcasting.com/artifacts/com.headius/unsafe-fences/
implementation ("com.headius:unsafe-fences:1.0")
'com.headius:unsafe-fences:jar:1.0'
<dependency org="com.headius" name="unsafe-fences" rev="1.0">
  <artifact name="unsafe-fences" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.headius', module='unsafe-fences', version='1.0')
)
libraryDependencies += "com.headius" % "unsafe-fences" % "1.0"
[com.headius/unsafe-fences "1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

unsafe-fences

This library is very simple: it just provides a shim around the Java 8 Unsafe methods used for memory fencing. Because these methods do not exist in the Java 6 and Java 7 Unsafe, this library allows compiling those calls with a provided boolean guard.

This library must be built on Java 8 or a version of Java that has the three fence methods: fullFence, storeFence, and loadFence.

Usage

Simply use com.headius.unsafe.fences.UnsafeFences.SUPPORTS_FENCES and the shim *Fence methods to call the fence API safely across Java versions.

Versions

Version
1.0