Methode run() in Printer.java korrigiert.
This commit is contained in:
parent
662dbdd021
commit
2e7bf12166
|
@ -15,6 +15,7 @@ public class Printer {
|
|||
private static class PrinterThread extends Thread {
|
||||
char symbol;
|
||||
int sleepTime;
|
||||
Thread current_thread = this;
|
||||
|
||||
public PrinterThread(String name, char symbol, int sleepTime) {
|
||||
super(name);
|
||||
|
@ -24,7 +25,7 @@ public class Printer {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
if(Thread.currentThread().getName().equals("main")){
|
||||
if(Thread.currentThread() != current_thread){
|
||||
return;
|
||||
}
|
||||
System.out.println(getName() + " run started...");
|
||||
|
|
Loading…
Reference in New Issue