pt.ua.concurrent
Interface SyncCV

All Superinterfaces:
InterruptibleAwaitingThreads
All Known Implementing Classes:
BinarySemaphore, BoundedSemaphore, CObject, DynamicBarrier, Event, Exchanger, FixedBarrier, GroupMutex, GroupMutexComposedCV, GroupMutexCV, Mutex, MutexCV, PersistentSignal, RWEx, RWExCV, Semaphore, TransientSignal

public interface SyncCV
extends InterruptibleAwaitingThreads

Java's interface for condition variables.

This class follows DbC(tm) methodology (Wikipedia). Where possible, contracts are implement with native's Java assert.

Version:
0.5, October 2013
Author:
Miguel Oliveira e Silva (mos@ua.pt)

Method Summary
 void await()
          Condition variable wait service.
 void broadcast()
          Condition variable broadcast (notifyAll) service.
 boolean lockIsMine()
          Is lock owned by me?
 void signal()
          Condition variable signal (notify) service.
 
Methods inherited from interface pt.ua.concurrent.InterruptibleAwaitingThreads
interruptWaitingThreads, registerAwaitingThreads
 

Method Detail

lockIsMine

boolean lockIsMine()
Is lock owned by me?

Returns:
true, if lock is mine

await

void await()
           throws ThreadInterruptedException
Condition variable wait service.

Precondition:
lockIsMine() - lock owned by me

Throws:
ThreadInterruptedException

signal

void signal()
Condition variable signal (notify) service.

Precondition:
lockIsMine() - lock owned by me


broadcast

void broadcast()
Condition variable broadcast (notifyAll) service.

Precondition:
lockIsMine() - lock owned by me