TD1: Refactor the client side code.
[TD_SR.git] / TD1 / exo3 / Producteur.java
index 47a402180d5f8c9a6fa4854bc4b3b03f76c97858..36b67a316b4153b29d7a2c69b08d87823f7ef56f 100644 (file)
@@ -23,12 +23,14 @@ public class Producteur implements Runnable {
        public void run() {
                while (true) {
                        buffer.depose(new Integer(val));
-                       System.out.println (Thread.currentThread().getName() +  " a depose " + val);
+                       System.out.println(Thread.currentThread().getName() +   " a depose " + val);
                        val++;
                        try {
                                Thread.sleep(ThreadLocalRandom.current().nextInt(101));
                        }
-                       catch (InterruptedException e) {}
+                       catch (InterruptedException e) {
+                               System.err.println("InterruptedException: " + e);
+                       }
                }
        }