Professional Documents
Culture Documents
Exo 6
Exo 6
int n;
String name;
public Semaphore (int max, String S) {
this.n=max;
this.name=S;
}
}
public synchronized void V(Semaphore A) {
n++;
if (n<=0)
A.notify();
}
}