Use stderr where appropriate.
[TD_SR.git] / TD1 / exo3 / BufferCirc.java
index 91c458bc18894aced8aff2ecfd23af8e53847a69..3c7a65efc1d554ee7c1415a4414916610d11b293 100644 (file)
@@ -33,10 +33,12 @@ public class BufferCirc {
                while(isFull()) {
                        try {
                                System.out.println("Buffer is full: " + Thread.currentThread().getName()
-                                    + " is waiting, size: " + nbObj);
+                                                                  + " is waiting, size: " + nbObj);
                                wait();
                        }
-                       catch (InterruptedException e) {}
+                       catch (InterruptedException e) {
+                               System.err.println("InterruptedException: " + e);
+                       }
                }
                nbObj++;
                tampon[prem] = obj;
@@ -50,10 +52,12 @@ public class BufferCirc {
                while(isEmpty()) {
                        try {
                                System.out.println("Buffer is empty: " + Thread.currentThread().getName()
-                                    + " is waiting, size: " + nbObj);
+                                                                  + " is waiting, size: " + nbObj);
                                wait();
                        }
-                       catch (InterruptedException e) {}
+                       catch (InterruptedException e) {
+                               System.err.println("InterruptedException: " + e);
+                       }
                }
                Object outObj = null;
                nbObj--;