rrdService.util
Class Mutex

java.lang.Object
  |
  +--rrdService.util.Mutex
All Implemented Interfaces:
java.io.Serializable

public class Mutex
extends java.lang.Object
implements java.io.Serializable

The class Mutex implement a mutex

Version:
1.0 date : 15/07/2001
key-word
shared variable
Author:
Damien Pellier
See Also:
Mutex, Lock, Serialized Form

Field Summary
private  int cpt
          allow to count the number of thread which call the mutex
 
Constructor Summary
Mutex(int q)
          Constructor of class Mutex
 
Method Summary
 int getNbThreadLocked()
          getNbThreadLocked return the number of thread lock on the mutex
 void P()
          Lock mutex
 java.lang.String toString()
          return a String representation of a mutex
 void V()
          Unlock mutex
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

cpt

private int cpt
allow to count the number of thread which call the mutex
Constructor Detail

Mutex

public Mutex(int q)
Constructor of class Mutex
Parameters:
q - a int which initialize the mutex
Method Detail

getNbThreadLocked

public int getNbThreadLocked()
getNbThreadLocked return the number of thread lock on the mutex

P

public void P()
Lock mutex

toString

public java.lang.String toString()
return a String representation of a mutex
Overrides:
toString in class java.lang.Object

V

public void V()
Unlock mutex

Copyright 1885-2001 FIRMENICH SA, Geneva

Submit a bug or feature
Copyright 1885-2001 FIRMENICH SA, Geneva,
All Rights Reserved.