X-Git-Url: https://git.piment-noir.org/?p=TD_SR.git;a=blobdiff_plain;f=TD1%2Fexo2%2FThreadJob.java;fp=TD1%2Fexo2%2FExThread.java;h=dae83baa750588b57e0523d1a0797e56241951e9;hp=387ea8da3a05f9d8091015960c8edef9b318edcd;hb=06566a55e1640e3c2c22785dd5ce7d19c947940a;hpb=7e42d822cf647a90586c45a7b2f5c649f8f81cb9 diff --git a/TD1/exo2/ExThread.java b/TD1/exo2/ThreadJob.java similarity index 74% rename from TD1/exo2/ExThread.java rename to TD1/exo2/ThreadJob.java index 387ea8d..dae83ba 100644 --- a/TD1/exo2/ExThread.java +++ b/TD1/exo2/ThreadJob.java @@ -1,9 +1,8 @@ import java.util.Random; -public class ExThread implements Runnable { - String threadName; +public class ThreadJob implements Runnable { - ExThread(String name) { + ThreadJob(String name) { setName(name); } @@ -22,7 +21,7 @@ public class ExThread implements Runnable { // this part is executed when an exception (in this example InterruptedException) occurs } String threadName = Thread.currentThread().getName(); - System.out.println(threadName + " has sleept for " + sleep_time + " ms for the " + (j + 1) + " times"); + System.out.println(threadName + " has slept for " + sleep_time + " ms for the " + (j + 1) + " times"); } } }