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

SimpleLock

class SimpleLock extends BooleanSemaphore with Lock

A boolean semaphore viewed as a non-reentrant lock implementation

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SimpleLock
  2. Lock
  3. BooleanSemaphore
  4. Semaphore
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SimpleLock(name: String = null, parent: AnyRef = null)

    name

    the name of the lock (for the debugger).

    parent

    the component (if any) in which the mutex will be used (for the debugger).

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 acquire(): Unit

    Wait until the semaphore is unlocked.

    Wait until the semaphore is unlocked. If the acquiring thread is cancelled during the wait or the semaphore's cancel() method has been called, then rethrow the cancel.

    Definition Classes
    BooleanSemaphoreSemaphore
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val available: Boolean
    Definition Classes
    BooleanSemaphore
  7. def cancel(): Unit

    "Interrupt" each thread waiting to acquire this semaphore, causing the acquire to terminate, with cancelled() true.

    "Interrupt" each thread waiting to acquire this semaphore, causing the acquire to terminate, with cancelled() true.

    Definition Classes
    BooleanSemaphoreSemaphore
  8. def cancelled(): Boolean

    true if the semaphore has been cancelled during an acquire.

    true if the semaphore has been cancelled during an acquire.

    Definition Classes
    BooleanSemaphoreSemaphore
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def down(): Unit

    same as acquire

    same as acquire

    Definition Classes
    Semaphore
    Annotations
    @inline()
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. val fair: Boolean
    Definition Classes
    BooleanSemaphore
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def getWaiting: Seq[Thread]

    Return an (approximate) list of the threads waiting to acquire a token from this semaphore.

    Return an (approximate) list of the threads waiting to acquire a token from this semaphore. Intended for use only by diagnostic components.

    Definition Classes
    BooleanSemaphoreSemaphore
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def lock(): Unit
    Definition Classes
    SimpleLockLock
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  23. val parent: AnyRef
    Definition Classes
    BooleanSemaphore
  24. def release(): Unit

    Unlock the semaphore and permit an acquireing process to proceed.

    Unlock the semaphore and permit an acquireing process to proceed.

    Definition Classes
    BooleanSemaphoreSemaphore
  25. def remaining(): Int

    Approximation to the number of acquires that could now succeed without having to wait.

    Approximation to the number of acquires that could now succeed without having to wait. Intended for use only by diagnostic components.

    Definition Classes
    BooleanSemaphoreSemaphore
  26. val spin: Int
    Definition Classes
    BooleanSemaphore
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    BooleanSemaphore → AnyRef → Any
  29. def tryAcquire(timeoutNS: Long): Boolean

    Wait until the semaphore becomes available (returning true) or until the specified timeout has elapsed (returning false).

    Wait until the semaphore becomes available (returning true) or until the specified timeout has elapsed (returning false). Unlike java.util.concurrent.Semaphore an invoking thread that needs to wait joins the queue of waiting threads -- threads with shorter timeouts are not prioritised over those with longer deadlines or no deadline. If the acquiring thread is cancelled during the wait or the semaphore's cancel() method has been called, then the cancelled() method will return true.

    Definition Classes
    BooleanSemaphoreSemaphore
  30. def unlock(): Unit
    Definition Classes
    SimpleLockLock
  31. def up(): Unit

    same as release

    same as release

    Definition Classes
    Semaphore
    Annotations
    @inline()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. 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 BooleanSemaphore

Inherited from semaphore.Semaphore

Inherited from AnyRef

Inherited from Any

Ungrouped