X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TD1%2Fexo3%2FBufferCirc.java;h=486951502caffd1d4925291dfa37eb1d74372f74;hb=7293fe6dc670d5164859159aab339fa3a4750773;hp=91c458bc18894aced8aff2ecfd23af8e53847a69;hpb=367e2930690ae79b8a9bbb641953fcb43f3854dd;p=TD_SR.git diff --git a/TD1/exo3/BufferCirc.java b/TD1/exo3/BufferCirc.java index 91c458b..4869515 100644 --- a/TD1/exo3/BufferCirc.java +++ b/TD1/exo3/BufferCirc.java @@ -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.out.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.out.println("InterruptedException: " + e); + } } Object outObj = null; nbObj--;