monifu.concurrent.locks

SpinLock

final class SpinLock extends Lock

A very efficient implementation of a java.util.concurrent.locks.Lock that is based on spinlock-ing.

Linear Supertypes
Lock, java.util.concurrent.locks.Lock, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SpinLock
  2. Lock
  3. Lock
  4. AnyRef
  5. 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  11. def isAcquiredByCurrentThread: Boolean

    Meant for reentrancy logic.

    Meant for reentrancy logic.

    returns

    true if this lock is acquired by the current thread or false otherwise

    Definition Classes
    SpinLockLock
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. final def lock(): Unit

    Acquires the lock.

    Acquires the lock.

    If the lock is not available, then the thread waits until is able to acquire the lock. Does not interrupt - for interrupting see lockInterruptibly instead.

    Definition Classes
    Lock → Lock
    Exceptions thrown
    IllegalMonitorStateException

    in case the lock is already acquired.

  14. final def lockInterruptibly(): Unit

    Acquires the lock.

    Acquires the lock.

    If the lock is not available, then the thread waits until is able to acquire the lock. Can be interrupted.

    Definition Classes
    Lock → Lock
    Annotations
    @throws( classOf[InterruptedException] )
    Exceptions thrown
    IllegalMonitorStateException

    in case the lock is already acquired.

    InterruptedException

    in case the thread was interrupted with Thread.interrupt()

  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def newCondition(): Condition

    Returns a new Condition instance that is bound to this Lock instance.

    Returns a new Condition instance that is bound to this Lock instance.

    Definition Classes
    SpinLockLock → Lock
  17. final def notify(): Unit

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

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def tryLock(time: Long, unit: TimeUnit): Boolean

    Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.

    Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.

    time

    the maximum time to wait for the lock

    unit

    the time unit of the time argument

    returns

    true if the lock was successfully acquired or false if the waiting time elapsed before the lock was acquired

    Definition Classes
    Lock → Lock
    Annotations
    @throws( classOf[InterruptedException] )
    Exceptions thrown
    IllegalMonitorStateException

    in case the lock is already acquired.

    java.lang.InterruptedException

    if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)

  22. final def tryLock(): Boolean

    Acquires the lock only if it is free at the time of invocation.

    Acquires the lock only if it is free at the time of invocation.

    returns

    either true if the lock was acquired or false otherwise.

    Definition Classes
    Lock → Lock
    Exceptions thrown
    IllegalMonitorStateException

    in case the lock is already acquired.

  23. final def unlock(): Unit

    Releases the acquired lock.

    Releases the acquired lock.

    Definition Classes
    Lock → Lock
  24. def unsafeLock(): Unit

    Acquires the lock.

    Acquires the lock. Compared to unsafeLock it doesn't do sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.

    If the lock is not available, then the thread waits until is able to acquire the lock. Does not interrupt - for interrupting see lockInterruptibly instead.

    Definition Classes
    SpinLockLock
    Annotations
    @tailrec()
  25. def unsafeLockInterruptibly(): Unit

    Acquires the lock.

    Acquires the lock. Compared to lockInterruptibly it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.

    If the lock is not available, then the thread waits until is able to acquire the lock. Can be interrupted.

    Definition Classes
    SpinLockLock
    Annotations
    @throws( classOf[InterruptedException] )
    Exceptions thrown
    IllegalMonitorStateException

    in case the lock is already acquired.

    InterruptedException

    in case the thread was interrupted with Thread.interrupt()

  26. def unsafeTryLock(time: Long, unit: TimeUnit): Boolean

    Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.

    Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted. Compared to tryLock it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.

    time

    the maximum time to wait for the lock

    unit

    the time unit of the time argument

    returns

    true if the lock was successfully acquired or false if the waiting time elapsed before the lock was acquired

    Definition Classes
    SpinLockLock
    Annotations
    @throws( classOf[InterruptedException] )
    Exceptions thrown
    java.lang.InterruptedException

    if the current thread is interrupted while acquiring the lock (and interruption of lock acquisition is supported)

  27. def unsafeTryLock(): Boolean

    Acquires the lock only if it is free at the time of invocation.

    Acquires the lock only if it is free at the time of invocation. Compared to tryLock it doesn't do any sanity checks, so used unwisely it may lead to deadlocks or other undesired behavior.

    returns

    either true if the lock was acquired or false otherwise.

    Definition Classes
    SpinLockLock
  28. def unsafeUnlock(): Unit

    Releases the acquired lock without doing any safety checks.

    Releases the acquired lock without doing any safety checks.

    Definition Classes
    SpinLockLock
  29. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Lock

Inherited from java.util.concurrent.locks.Lock

Inherited from AnyRef

Inherited from Any

Ungrouped