Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1818b9b

Browse files
author
Maciej Mozolewski
committed
intelij
1 parent 2dac69b commit 1818b9b

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

JavaMultiThreadingCodes/src/StartingThreads_1/ApplicationExtends.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* <br>
1111
* also freely available at
1212
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
13-
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
13+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
1414
* </a>
1515
*
1616
* @author Z.B. Celik <[email protected]>
@@ -19,7 +19,7 @@ class Runner extends Thread {
1919

2020
@Override
2121
public void run() {
22-
for (int i = 0; i < 5; i++) {
22+
for (int i = 0; i < 10; i++) {
2323
System.out.println("Hello: " + i + " Thread: " + Thread.currentThread().getName());
2424
try {
2525
Thread.sleep(100);
@@ -32,12 +32,16 @@ public void run() {
3232

3333
public class ApplicationExtends {
3434

35-
public static void main(String[] args) {
35+
public static void main(String[] args) throws InterruptedException {
3636
Runner runner1 = new Runner();
3737
runner1.start();
3838

3939
Runner runner2 = new Runner();
4040
runner2.start();
41+
42+
Thread.sleep(200);
43+
runner1.stop();
44+
4145
}
4246

4347
}

JavaMultiThreadingCodes/src/tests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import java.util.Random;
32
import java.util.concurrent.Semaphore;
43

0 commit comments

Comments
 (0)