From: Jérôme Benoit Date: Fri, 8 Jun 2018 18:19:17 +0000 (+0200) Subject: TD1: fix thread name setting. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;p=TD_SR.git TD1: fix thread name setting. Signed-off-by: Jérôme Benoit --- diff --git a/TD1/exo3/Consommateur.java b/TD1/exo3/Consommateur.java index a857e7e..1282499 100644 --- a/TD1/exo3/Consommateur.java +++ b/TD1/exo3/Consommateur.java @@ -9,13 +9,13 @@ public class Consommateur implements Runnable { buffer = b; } - public Consommateur(BufferCirc b, String name) { + public Consommateur(BufferCirc b, Thread th, String name) { buffer = b; - setThName(name); + setThName(th, name); } - public void setThName(String name) { - Thread.currentThread().setName(name); + public void setThName(Thread th, String name) { + th.setName(name); } public void run() { diff --git a/TD1/exo3/Producteur.java b/TD1/exo3/Producteur.java index 732fafa..5e09d50 100644 --- a/TD1/exo3/Producteur.java +++ b/TD1/exo3/Producteur.java @@ -11,13 +11,13 @@ public class Producteur implements Runnable { buffer = b; } - public Producteur(BufferCirc b, String name) { + public Producteur(BufferCirc b, Thread th, String name) { buffer = b; - setThName(name); + setThName(th, name); } - public void setThName(String name) { - Thread.currentThread().setName(name); + public void setThName(Thread th, String name) { + th.setName(name); } public void run() {