BAEL-1263 Daemon Threads in Java
This commit is contained in:
parent
31e2f177ad
commit
1be0d76f8c
@ -3,6 +3,7 @@ package com.baeldung.concurrent.daemon;
|
|||||||
public class NewThread extends Thread {
|
public class NewThread extends Thread {
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
while (true)
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
System.out.println("New Thread is running...");
|
System.out.println("New Thread is running...");
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,4 @@ public class DaemonThreadTest {
|
|||||||
daemonThread.start();
|
daemonThread.start();
|
||||||
daemonThread.setDaemon(true);
|
daemonThread.setDaemon(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void givenUserThread_whenStartThread_thenFalse() {
|
|
||||||
NewThread daemonThread = new NewThread();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user