From 2ef76f09b55d5e1d5ad9535603688b42e91c0783 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 8 Jun 2018 20:19:17 +0200 Subject: [PATCH] TD1: fix thread name setting. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TD1/exo3/Consommateur.java | 8 ++++---- TD1/exo3/Producteur.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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() { -- 2.34.1