Skip to content

Commit 243545f

Browse files
author
turingfly
committed
Concurrency
1 parent 98c4cb4 commit 243545f

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

Java-8/src/concurrency/IntroducingThreads.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void understandingThreadConcurrency() {
8585
* java.lang.Runnable, or Runnable for short, is a functional interface that
8686
* takes no arguments and returns no data.
8787
*
88-
* The Runnable interface is commonly used to defined the work a thread will
88+
* The Runnable interface is commonly used to define the work a thread will
8989
* execute, separate from the main application thread.
9090
*
9191
*

Java-8/src/concurrency/ManagingConcurrentProcesses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ManagingConcurrentProcesses {
1919
/**
2020
* The CyclicBarrier takes in its constructors a limit value, indicating the
2121
* number of threads to wait for. As each thread nishes, it calls the
22-
* await() method on the cyclic barrier. Once the speci ed number of threads
22+
* await() method on the cyclic barrier. Once the specified number of threads
2323
* have each called await(), the barrier is released and all threads can
2424
* continue.
2525
*/

Java-8/src/concurrency/UsingConcurrentCollections.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,6 @@ public void blockingQueues() {
6262
System.out.println(blockingDeque.pollLast(1, TimeUnit.SECONDS));
6363
} catch (InterruptedException e) { // Handle interruption
6464
}
65-
66-
try {
67-
BlockingDeque<Integer> blockingDeque = new LinkedBlockingDeque<>();
68-
blockingDeque.offer(91);
69-
blockingDeque.offerFirst(5, 2, TimeUnit.MINUTES);
70-
blockingDeque.offerLast(47, 100, TimeUnit.MICROSECONDS);
71-
blockingDeque.offer(3, 4, TimeUnit.SECONDS);
72-
System.out.println(blockingDeque.poll());
73-
System.out.println(blockingDeque.poll(950, TimeUnit.MILLISECONDS));
74-
System.out.println(blockingDeque.pollFirst(200, TimeUnit.NANOSECONDS));
75-
System.out.println(blockingDeque.pollLast(1, TimeUnit.SECONDS));
76-
} catch (InterruptedException e) { // Handle interruption
77-
}
7865
}
7966

8067
/**

0 commit comments

Comments
 (0)