sun.misc.Unsafe.putIntVolatile()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中sun.misc.Unsafe.putIntVolatile()方法的一些代码示例,展示了Unsafe.putIntVolatile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.putIntVolatile()方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:putIntVolatile

Unsafe.putIntVolatile介绍

[英]Stores an int field into the given object, using volatile semantics.
[中]使用volatile语义将int字段存储到给定对象中。

代码示例

代码示例来源:origin: redisson/redisson

@Override
public void putIntVolatile(long byteIndex, int i) {
  unsafe.putIntVolatile(null, baseAdress + byteIndex, i);
}

代码示例来源:origin: redisson/redisson

@Override
public void putIntVolatile(long byteIndex, int i) {
  unsafe.putIntVolatile(base, off + byteIndex, i);
}

代码示例来源:origin: neo4j/neo4j

public static void putIntVolatile( Object obj, long offset, int value )
{
  unsafe.putIntVolatile( obj, offset, value );
}

代码示例来源:origin: apache/ignite

/**
 * Stores integer value with volatile semantic.
 *
 * @param obj Object.
 * @param off Offset.
 * @param val Value.
 */
public static void putIntVolatile(Object obj, long off, int val) {
  UNSAFE.putIntVolatile(obj, off, val);
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public void putIntVolatile(long byteIndex, int i) {
  unsafe.putIntVolatile(null, baseAdress + byteIndex, i);
}

代码示例来源:origin: RuedigerMoeller/fast-serialization

@Override
public void putIntVolatile(long byteIndex, int i) {
  unsafe.putIntVolatile(base, off + byteIndex, i);
}

代码示例来源:origin: apache/geode

public void putIntVolatile(Object o, long offset, int v) {
 this.unsafe.putIntVolatile(o, offset, v);
}

代码示例来源:origin: fengjiachun/Jupiter

public void putIntVolatile(Object target, long offset, int value) {
  unsafe.putIntVolatile(target, offset, value);
}

代码示例来源:origin: fengjiachun/Jupiter

public void putIntVolatile(Object target, long offset, int value) {
  unsafe.putIntVolatile(target, offset, value);
}

代码示例来源:origin: neo4j/neo4j

public static void putIntVolatile( long address, int value )
{
  checkAccess( address, Integer.BYTES );
  unsafe.putIntVolatile( null, address, value );
}

代码示例来源:origin: robovm/robovm

/**
 * Sets the element at position {@code i} to the given value.
 *
 * @param i the index
 * @param newValue the new value
 */
public final void set(int i, int newValue) {
  unsafe.putIntVolatile(array, checkedByteOffset(i), newValue);
}

代码示例来源:origin: robovm/robovm

public void set(T obj, int newValue) {
  if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj);
  unsafe.putIntVolatile(obj, offset, newValue);
}

代码示例来源:origin: real-logic/agrona

public void putIntVolatile(final long index, final int value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_INT);
  }
  UNSAFE.putIntVolatile(null, addressOffset + index, value);
}

代码示例来源:origin: real-logic/agrona

public void putIntVolatile(final int index, final int value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_INT);
  }
  UNSAFE.putIntVolatile(byteArray, addressOffset + index, value);
}

代码示例来源:origin: aaberg/sql2o

public void setProperty(Object obj, Object value) {
  if (value == null) return;
  theUnsafe.putIntVolatile(obj, offset, ((Number) value).intValue());
}

代码示例来源:origin: MyCATApache/Mycat-JCache

/**
 * Writes an int (volatile) to the specified position.
 * 
 * @param pos
 *            the position in the memory addrress
 * @param val
 *            the value to write
 */
public static void putIntVolatile(long pos, int val) {
  unsafe.putIntVolatile(null, pos, val);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Sets the element at position {@code i} to the given value.
 *
 * @param i the index
 * @param newValue the new value
 */
public final void set(int i, int newValue) {
  unsafe.putIntVolatile(array, checkedByteOffset(i), newValue);
}

代码示例来源:origin: org.agrona/Agrona

public void putIntVolatile(final long index, final int value)
{
  if (SHOULD_BOUNDS_CHECK)
  {
    boundsCheck0(index, SIZE_OF_INT);
  }
  UNSAFE.putIntVolatile(null, addressOffset + index, value);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Sets the element at position {@code i} to the given value.
 *
 * @param i the index
 * @param newValue the new value
 */
public final void set(int i, int newValue) {
  unsafe.putIntVolatile(array, checkedByteOffset(i), newValue);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public void putIntVolatile(Object base, long offset, int x) {
  AlignmentUtil.check4BytesAligned(offset);
  UNSAFE.putIntVolatile(base, offset, x);
}

相关文章

微信公众号

最新文章

更多

Unsafe类方法