TD1: Explain and fix the deadlock in exo3.
[TD_SR.git] / TD1 / exo3 / BufferCirc.java
index 68f1f1f9fd922c1eab10fcf1d1f52a336156c605..ebfb2877016fdc978bf4e47b6d61ba9b9e2cb6c3 100644 (file)
@@ -43,7 +43,7 @@ public class BufferCirc {
                tampon[prem] = obj;\r
                prem = (prem + 1) % taille;\r
                //System.out.println(Thread.currentThread().getName() + " a depose " + (Integer)obj);\r
-               notify();\r
+               notifyAll();\r
        }\r
 \r
 \r
@@ -61,7 +61,7 @@ public class BufferCirc {
                outObj = tampon[der];\r
                der = (der + 1) % taille;\r
                //System.out.println(Thread.currentThread().getName() + " a preleve " + (Integer)outObj);\r
-               notify();\r
+               notifyAll();\r
                return outObj;\r
        }\r
 \r