monifu.concurrent.misc

Unsafe

object Unsafe

The quasi-standard way for Java code to gain access to and use functionality which, when unsupervised, would allow one to break the pointer/type safety of Java.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Unsafe
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def arrayBaseOffset(clazz: Class[_]): Int

    Gets the offset from the start of an array object's memory to the memory used to store its initial (zeroeth) element.

    Gets the offset from the start of an array object's memory to the memory used to store its initial (zeroeth) element.

    clazz

    non-null; class in question; must be an array class

    returns

    the offset to the initial element

  5. def arrayIndexScale(clazz: Class[_ <: Array[_]]): Int

    Gets the size of each element of the given array class.

    Gets the size of each element of the given array class.

    clazz

    non-null; class in question; must be an array class

    returns

    > 0; the size of each element of the array

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compareAndSwapInt(obj: AnyRef, offset: Long, expect: Int, update: Int): Boolean

    Performs a compare-and-set operation on an int field within the given object.

    Performs a compare-and-set operation on an int field within the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    expect

    expected value of the field

    update

    new value to store in the field if the contents are as expected

    returns

    true if the new value was in fact stored, false otherwise

  9. def compareAndSwapLong(obj: AnyRef, offset: Long, expect: Long, update: Long): Boolean

    Performs a compare-and-set operation on an long field within the given object.

    Performs a compare-and-set operation on an long field within the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    expect

    expected value of the field

    update

    new value to store in the field if the contents are as expected

    returns

    true if the new value was in fact stored, false otherwise

  10. def compareAndSwapObject(obj: AnyRef, offset: Long, expect: AnyRef, update: AnyRef): Boolean

    Performs a compare-and-set operation on an AnyRef field (that is, a reference field) within the given object.

    Performs a compare-and-set operation on an AnyRef field (that is, a reference field) within the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    expect

    expected value of the field

    update

    new value to store in the field if the contents are as expected

    returns

    true if the new value was in fact stored, false otherwise

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def getIntVolatile(obj: AnyRef, offset: Long): Int

    Gets an Int field from the given object, using volatile semantics.

    Gets an Int field from the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    returns

    the retrieved value

  16. def getLong(obj: AnyRef, offset: Long): Long

    Gets a long field from the given object.

    Gets a long field from the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    returns

    the retrieved value

  17. def getLongVolatile(obj: AnyRef, offset: Long): Long

    Gets a Long field from the given object, using volatile semantics.

    Gets a Long field from the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    returns

    the retrieved value

  18. def getObject(obj: AnyRef, offset: Long): AnyRef

    Gets an object field from the given object.

    Gets an object field from the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    returns

    the retrieved value

  19. def getObjectVolatile(obj: AnyRef, offset: Long): AnyRef

    Gets an AnyRef field from the given object, using volatile semantics.

    Gets an AnyRef field from the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    returns

    the retrieved value

  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def objectFieldOffset(field: Field): Long

    Gets the raw byte offset from the start of an object's memory to the memory used to store the indicated instance field.

    Gets the raw byte offset from the start of an object's memory to the memory used to store the indicated instance field.

    field

    non-null; the field in question, which must be an instance field

    returns

    the offset to the field

  26. def park(absolute: Boolean, time: Long): Unit

    Parks the calling thread for the specified amount of time, unless the "permit" for the thread is already available (due to a previous call to unpark.

    Parks the calling thread for the specified amount of time, unless the "permit" for the thread is already available (due to a previous call to unpark. This method may also return spuriously (that is, without the thread being told to unpark and without the indicated amount of time elapsing).

    absolute

    whether the given time value is absolute milliseconds-since-the-epoch (true) or relative nanoseconds-from-now (false)

    time

    the (absolute millis or relative nanos) time value

  27. def putIntVolatile(obj: AnyRef, offset: Long, update: Int): Unit

    Stores an Int field into the given object, using volatile semantics.

    Stores an Int field into the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    update

    the value to store

  28. def putLong(obj: AnyRef, offset: Long, update: Long): Unit

    Stores a long field into the given object.

    Stores a long field into the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    update

    the value to store

  29. def putLongVolatile(obj: AnyRef, offset: Long, update: Long): Unit

    Stores an Long field into the given object, using volatile semantics.

    Stores an Long field into the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    update

    the value to store

  30. def putObject(obj: AnyRef, offset: Long, update: AnyRef): Unit

    Stores a object field into the given object.

    Stores a object field into the given object.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    update

    the value to store

  31. def putObjectVolatile(obj: AnyRef, offset: Long, update: AnyRef): Unit

    Stores an AnyRef field into the given object, using volatile semantics.

    Stores an AnyRef field into the given object, using volatile semantics.

    obj

    non-null; object containing the field

    offset

    offset to the field within obj

    update

    the value to store

  32. def putOrderedInt(obj: AnyRef, offset: Long, update: Int): Unit

    Lazy set an Int field.

  33. def putOrderedLong(obj: AnyRef, offset: Long, update: Long): Unit

    Lazy set a Long field.

  34. def putOrderedObject(obj: AnyRef, offset: Long, update: AnyRef): Unit

    Lazy set an AnyRef field.

  35. def staticFieldBase(field: Field): AnyRef

    Report the location of a given static field, in conjunction with staticFieldOffset.

    Report the location of a given static field, in conjunction with staticFieldOffset.

    Fetch the base "Object", if any, with which static fields of the given class can be accessed via methods like getIntVolatile. This value may be null. This value may refer to an object which is a "cookie", not guaranteed to be a real Object, and it should not be used in any way except as argument to the get and put routines in this class.

  36. def staticFieldOffset(field: Field): Long

    Gets the raw byte offset from the start of an object's memory to the memory used to store the indicated static field.

    Gets the raw byte offset from the start of an object's memory to the memory used to store the indicated static field.

    field

    non-null; the field in question, which must be a static field

    returns

    the offset to the field

  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. def toString(): String

    Definition Classes
    AnyRef → Any
  39. def unpark(thread: Thread): Unit

    Unparks the given object, which must be a Thread.

    Unparks the given object, which must be a Thread.

    See java.util.concurrent.locks.LockSupport for more in-depth information of the behavior of this method.

    thread

    non-null; the thread to unpark

  40. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped