Skip to content

Commit e74c9bd

Browse files
author
Bruce Eckel
committed
Added timeout
1 parent 6ffeb5f commit e74c9bd

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

concurrency/AtomicityTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5+
// {TimeOutDuringTesting} (on single-core machines)
56
import java.util.concurrent.*;
67

78
public class AtomicityTest implements Runnable {
@@ -27,5 +28,5 @@ public static void main(String[] args) {
2728
}
2829
}
2930
/* Output:
30-
1
31+
73
3132
*/

concurrency/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<jrun cls="ActiveObjectDemo" />
1111
<jrun cls="AtomicEvenSupplier" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
1212
<jrun cls="AtomicIntegerTest" />
13-
<jrun cls="AtomicityTest" />
13+
<jrun cls="AtomicityTest" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
1414
<jrun cls="AttemptLocking" />
1515
<jrun cls="BankTellerSimulation" arguments="5" />
1616
<jrun cls="BasicThreads" />

remote/ptime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ sh registry.sh 3 &
22
sleep 1
33
sh server.sh 3 &
44
sleep 1
5-
java DisplayPerfectTime
5+
java DisplayPerfectTime

remote/registry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
rmiregistry &
22
sleep $1
3-
killall rmiregistry
3+
killall rmiregistry

0 commit comments

Comments
 (0)