Skip to content

Commit ddc9c62

Browse files
committed
JavaDoc optimized
1 parent b15dc75 commit ddc9c62

File tree

22 files changed

+200
-83
lines changed

22 files changed

+200
-83
lines changed

JavaMultiThreadingCodes/src/Deadlock_11/Account.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package Deadlock_11;
22

33
/**
4-
* Codes with minor comments are from http://www.caveofprogramming.com/youtube/
4+
* Codes with minor comments are from
5+
* <a href="http://www.caveofprogramming.com/youtube/">
6+
* <em>http://www.caveofprogramming.com/youtube/</em>
7+
* </a>
8+
* <br>
59
* also freely available at
6-
* https://www.udemy.com/java-multithreading/?couponCode=FREE
10+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
11+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
12+
* </a>
713
*
814
* @author Z.B. Celik <[email protected]>
915
*/
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
package Deadlock_11;
22

33
/**
4-
* Deadlock can occur in a situation when a thread is waiting for an object
5-
* lock, that is acquired by another thread and second thread is waiting for an
4+
* <a href="https://wikipedia.org/wiki/Deadlock">Deadlock</a>
5+
* can occur in a situation when a thread is waiting for an object's lock,
6+
* that is acquired by another thread and the second thread is waiting for an
67
* object lock that is acquired by first thread. Since, both threads are waiting
78
* for each other to release the lock, the condition is called deadlock. If you
89
* make sure that all locks are always taken in the same order by any thread,
910
* deadlocks cannot occur.
10-
*
11-
* Codes with minor comments are from http://www.caveofprogramming.com/youtube/
11+
* <br><br>
12+
* Codes with minor comments are from
13+
* <a href="http://www.caveofprogramming.com/youtube/">
14+
* <em>http://www.caveofprogramming.com/youtube/</em>
15+
* </a>
16+
* <br>
1217
* also freely available at
13-
* https://www.udemy.com/java-multithreading/?couponCode=FREE
18+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
19+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
20+
* </a>
1421
*
1522
* @author Z.B. Celik <[email protected]>
1623
*/
@@ -22,21 +29,15 @@ public static void main(String[] args) throws Exception {
2229
public void run() {
2330
try {
2431
runner.firstThread();
25-
} catch (InterruptedException e) {
26-
// TODO Auto-generated catch block
27-
e.printStackTrace();
28-
}
32+
} catch (InterruptedException ignored) {}
2933
}
3034
});
3135

3236
Thread t2 = new Thread(new Runnable() {
3337
public void run() {
3438
try {
3539
runner.secondThread();
36-
} catch (InterruptedException e) {
37-
// TODO Auto-generated catch block
38-
e.printStackTrace();
39-
}
40+
} catch (InterruptedException ignored) {}
4041
}
4142
});
4243

@@ -46,5 +47,4 @@ public void run() {
4647
t2.join();
4748
runner.finished();
4849
}
49-
5050
}

JavaMultiThreadingCodes/src/Deadlock_11/Runner.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
package Deadlock_11;
1+
package Deadlock_11;
22

3-
/**
4-
* Deadlocks
5-
*
6-
* Codes with minor comments are from http://www.caveofprogramming.com/youtube/
7-
* also freely available at
8-
* https://www.udemy.com/java-multithreading/?couponCode=FREE
9-
*
10-
* @author Z.B. Celik <[email protected]>
11-
*/
123
import java.util.Random;
134
import java.util.concurrent.locks.Lock;
145
import java.util.concurrent.locks.ReentrantLock;
156

16-
public class Runner {
7+
/**
8+
* <a href="https://wikipedia.org/wiki/Deadlock">Deadlock</a>
9+
* <br><br>
10+
* Codes with minor comments are from
11+
* <a href="http://www.caveofprogramming.com/youtube/">
12+
* <em>http://www.caveofprogramming.com/youtube/</em>
13+
* </a>
14+
* <br>
15+
* also freely available at
16+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
17+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
18+
* </a>
19+
*
20+
* @author Z.B. Celik <[email protected]>
21+
*/
22+
public class Runner {
1723

1824
private Account acc1 = new Account();
1925
private Account acc2 = new Account();

JavaMultiThreadingCodes/src/JoiningAndSynchronizeThreads_3/Worker.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77
* {@code synchronized} ("only let one thread in here at a time".) and {@code join} ("wait until
88
* thread on which join has called finished") keyword.
99
* <br><br>
10-
* Codes with minor comments are from <em>http://www.caveofprogramming.com/youtube/</em><br>
10+
* Codes with minor comments are from
11+
* <a href="http://www.caveofprogramming.com/youtube/">
12+
* <em>http://www.caveofprogramming.com/youtube/</em>
13+
* </a>
14+
* <br>
1115
* also freely available at
12-
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
16+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
17+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
18+
* </a>
1319
*
1420
* @author Z.B. Celik <[email protected]>
1521
*/

JavaMultiThreadingCodes/src/LockObjects_4/App.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package LockObjects_4;
22

33
/**
4-
* Codes with minor comments are from <em>http://www.caveofprogramming.com/youtube/</em><br>
4+
* Codes with minor comments are from
5+
* <a href="http://www.caveofprogramming.com/youtube/">
6+
* <em>http://www.caveofprogramming.com/youtube/</em>
7+
* </a>
8+
* <br>
59
* also freely available at
6-
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
10+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
11+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
12+
* </a>
713
*
814
* @author Z.B. Celik <[email protected]>
915
*/

JavaMultiThreadingCodes/src/LockObjects_4/Worker.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
* making the method synchronized or making an object inside the method
1111
* synchronized, By defining two different locks we say that one thread may
1212
* execute the stageOne while other executes stageTwo.
13-
*
14-
* Codes with minor comments are from http://www.caveofprogramming.com/youtube/
13+
* <br><br>
14+
* Codes with minor comments are from
15+
* <a href="http://www.caveofprogramming.com/youtube/">
16+
* <em>http://www.caveofprogramming.com/youtube/</em>
17+
* </a>
18+
* <br>
1519
* also freely available at
16-
* https://www.udemy.com/java-multithreading/?couponCode=FREE
20+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
21+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
22+
* </a>
1723
*
1824
* @author Z.B. Celik <[email protected]>
1925
*/

JavaMultiThreadingCodes/src/LockObjects_4/WorkerMethodsSynchronized.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
* making the method synchronized or making "different" objects inside the
1111
* method synchronized, By defining two different locks we say that one thread
1212
* may execute the stageOne while other executes stageTwo.
13-
*
14-
* Codes with minor comments are from http://www.caveofprogramming.com/youtube/
13+
* <br><br>
14+
* Codes with minor comments are from
15+
* <a href="http://www.caveofprogramming.com/youtube/">
16+
* <em>http://www.caveofprogramming.com/youtube/</em>
17+
* </a>
18+
* <br>
1519
* also freely available at
16-
* https://www.udemy.com/java-multithreading/?couponCode=FREE
20+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
21+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
22+
* </a>
1723
*
1824
* @author Z.B. Celik <[email protected]>
1925
*/

JavaMultiThreadingCodes/src/LowLevelProducerConsumer_9/App.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
* the best way); but this tutorial will help you to understand how to use wait
99
* and notify.
1010
* <br><br>
11-
* Codes with minor comments are from <em>http://www.caveofprogramming.com/youtube/</em><br>
11+
* Codes with minor comments are from
12+
* <a href="http://www.caveofprogramming.com/youtube/">
13+
* <em>http://www.caveofprogramming.com/youtube/</em>
14+
* </a>
15+
* <br>
1216
* also freely available at
13-
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
17+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
18+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
19+
* </a>
1420
*
1521
* @author Z.B. Celik <[email protected]>
1622
*/

JavaMultiThreadingCodes/src/LowLevelProducerConsumer_9/Processor.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
package LowLevelProducerConsumer_9;
22

3+
import java.util.LinkedList;
4+
import java.util.Random;
5+
36
/**
4-
* Codes with minor comments are from <em>http://www.caveofprogramming.com/youtube/</em><br>
7+
* Codes with minor comments are from
8+
* <a href="http://www.caveofprogramming.com/youtube/">
9+
* <em>http://www.caveofprogramming.com/youtube/</em>
10+
* </a>
11+
* <br>
512
* also freely available at
13+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
614
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
15+
* </a>
716
*
817
* @author Z.B. Celik <[email protected]>
918
*/
10-
import java.util.LinkedList;
11-
import java.util.Random;
12-
1319
@SuppressWarnings("InfiniteLoopStatement")
1420
public class Processor {
1521

JavaMultiThreadingCodes/src/ProducerConsumer_7/App.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
* data items and adding them to a shared data store of some kind while one or
99
* more other threads process those items, removing them from the data store.
1010
* <br><br>
11-
* Codes with minor comments are from <em>http://www.caveofprogramming.com/youtube/</em><br>
11+
* Codes with minor comments are from
12+
* <a href="http://www.caveofprogramming.com/youtube/">
13+
* <em>http://www.caveofprogramming.com/youtube/</em>
14+
* </a>
15+
* <br>
1216
* also freely available at
13-
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
17+
* <a href="https://www.udemy.com/java-multithreading/?couponCode=FREE">
18+
* <em>https://www.udemy.com/java-multithreading/?couponCode=FREE</em>
19+
* </a>
1420
*
1521
* @author Z.B. Celik <[email protected]>
1622
*/

0 commit comments

Comments
 (0)