Packages

  • package root
    Definition Classes
    root
  • package io

    This is the documentation for the ThreadCSO Library.

    This is the documentation for the ThreadCSO Library. Notable packages include:

    Definition Classes
    root
  • package threadcso

    The standard threadCSO API.

    The standard threadCSO API. Most modules using CSO will need only the declaration:

    import io.threadcso._

    The present version of the ThreadCSO library API is 1.2Rr (for some number r)

    The revision number (Rr) will change if bugs are corrected but the code remains consistent with the previous API. Its minor version number will change if there is a correction to the code that breaks consistency with the previous API. Its major version will change if there is a substantial change in the semantics of an important CSO construct.

    August 2017: changes 1.1 => 1.2

    • renaming of very many internal classes and packages
    • basic channel implementations are more efficient, in some case much more so
    • alternation reliability improved
    • debugger registration of alternations is no longer needed
    • home-grown semaphores can specify which component they are part of: this makes interpreting a stack backtrace very much easier
    • there is a flexible logging system that is compatible with the debugger

    April 2016: changes 1.0 => 1.1

    • Extended rendezvous read operator is now ?? (was ?)
    • Extended rendezvous read event notation is now =??=> (was =?=>>)
    • The notation inport ? f is now equivalent to f(inport?()) This makes for a tidier layout when the function f is an explicit functional expression.

    Feb 1 2017: changes 1.1R1 => 1.1R2

    • Removed dependencies on deprecated Java->Scala functions: replaced with .asJava
    @author Bernard Sufrin, Oxford
    $Revision: 286 $
    $Date: 2017-11-18 17:41:30 +0000 (Sat, 18 Nov 2017) $
    Definition Classes
    io
  • package lock
    Definition Classes
    threadcso
  • AndBarrier
  • Barrier
  • CombiningBarrier
  • JavaLock
  • Lock
  • OrBarrier
  • SimpleLock
c

io.threadcso.lock

JavaLock

class JavaLock extends ReentrantLock with Lock

Reentrant lock implementation that uses the jdk.util.concurrent.lock.ReentrantLock class. If fair is true then the lock is first-come first-served. Under heavy contention this can be useful, but it imposes a significant performance penalty on the acquisition of the lock.

Linear Supertypes
Lock, ReentrantLock, Serializable, java.util.concurrent.locks.Lock, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JavaLock
  2. Lock
  3. ReentrantLock
  4. Serializable
  5. Lock
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JavaLock(fair: Boolean)

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 getHoldCount(): Int
    Definition Classes
    ReentrantLock
  11. def getOwner(): Thread
    Attributes
    protected[java.util.concurrent.locks]
    Definition Classes
    ReentrantLock
  12. final def getQueueLength(): Int
    Definition Classes
    ReentrantLock
  13. def getQueuedThreads(): Collection[Thread]
    Attributes
    protected[java.util.concurrent.locks]
    Definition Classes
    ReentrantLock
  14. def getWaitQueueLength(arg0: java.util.concurrent.locks.Condition): Int
    Definition Classes
    ReentrantLock
  15. def getWaiting: Seq[Thread]

    Return an approximate list of the threads waiting to acquire this lock

  16. def getWaitingThreads(arg0: java.util.concurrent.locks.Condition): Collection[Thread]
    Attributes
    protected[java.util.concurrent.locks]
    Definition Classes
    ReentrantLock
  17. final def hasQueuedThread(arg0: Thread): Boolean
    Definition Classes
    ReentrantLock
  18. final def hasQueuedThreads(): Boolean
    Definition Classes
    ReentrantLock
  19. def hasWaiters(arg0: java.util.concurrent.locks.Condition): Boolean
    Definition Classes
    ReentrantLock
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  21. final def isFair(): Boolean
    Definition Classes
    ReentrantLock
  22. def isHeldByCurrentThread(): Boolean
    Definition Classes
    ReentrantLock
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def isLocked(): Boolean
    Definition Classes
    ReentrantLock
  25. def lock(): Unit
    Definition Classes
    ReentrantLock → Lock
  26. def lockInterruptibly(): Unit
    Definition Classes
    ReentrantLock → Lock
    Annotations
    @throws( ... )
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def newCondition(): java.util.concurrent.locks.Condition
    Definition Classes
    ReentrantLock → Lock
  29. final def notify(): Unit
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  31. def numWaiting: Int

    Approximate number of threads waiting to acquire this Lock

  32. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    ReentrantLock → AnyRef → Any
  34. def tryLock(arg0: Long, arg1: TimeUnit): Boolean
    Definition Classes
    ReentrantLock → Lock
    Annotations
    @throws( ... )
  35. def tryLock(): Boolean
    Definition Classes
    ReentrantLock → Lock
  36. def tryLockFor[T](timeoutNS: Long)(body: ⇒ T)(otherwise: ⇒ T): T

    Try the lock for up to timeoutNS, and if it lock then evaluate body else evaluate otherwise

    Try the lock for up to timeoutNS, and if it lock then evaluate body else evaluate otherwise

    Annotations
    @inline()
  37. def unlock(): Unit
    Definition Classes
    ReentrantLock → Lock
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def withLock[T](body: ⇒ T): T

    evaluate body with the lock set; finally unset the lock

    evaluate body with the lock set; finally unset the lock

    Definition Classes
    Lock
    Annotations
    @inline()

Inherited from Lock

Inherited from ReentrantLock

Inherited from Serializable

Inherited from java.util.concurrent.locks.Lock

Inherited from AnyRef

Inherited from Any

Ungrouped