pt.ua.concurrent
Class GroupMutexCV

java.lang.Object
  extended by pt.ua.concurrent.CObject
      extended by pt.ua.concurrent.GroupMutexCV
All Implemented Interfaces:
InterruptibleAwaitingThreads, SyncCV

public class GroupMutexCV
extends CObject
implements SyncCV

Group exclusion conditional variable class.

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

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

Method Summary
 void await()
          Object's wait replacement, in which:
- the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException;
- supports the registration of waiting threads for interrupt purposes.
 void broadcast()
          Object's nofifyAll replacement.
 GroupMutex gmutex()
           
 boolean lockIsMine()
          Is lock owned by me?
 void signal()
          Object's nofify replacement.
 
Methods inherited from class pt.ua.concurrent.CObject
await, await, interruptWaitingThreads, registerAwaitingThreads, syncronizedLockIsMine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pt.ua.concurrent.InterruptibleAwaitingThreads
interruptWaitingThreads, registerAwaitingThreads
 

Method Detail

gmutex

public GroupMutex gmutex()

await

public void await()
Description copied from class: CObject
Object's wait replacement, in which:
- the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException;
- supports the registration of waiting threads for interrupt purposes.

Precondition:
syncronizedLockIsMine() - native lock owned by me

Specified by:
await in interface SyncCV
Overrides:
await in class CObject

signal

public void signal()
Description copied from class: CObject
Object's nofify replacement.

Precondition:
syncronizedLockIsMine() - native lock owned by me

Specified by:
signal in interface SyncCV
Overrides:
signal in class CObject

broadcast

public void broadcast()
Description copied from class: CObject
Object's nofifyAll replacement.

Precondition:
syncronizedLockIsMine() - native lock owned by me

Specified by:
broadcast in interface SyncCV
Overrides:
broadcast in class CObject

lockIsMine

public boolean lockIsMine()
Description copied from class: CObject
Is lock owned by me?

Specified by:
lockIsMine in interface SyncCV
Overrides:
lockIsMine in class CObject
Returns:
true, if lock is mine