git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[utils]
/
support
/
general
/
src
/
test
/
java
/
org
/
wamblee
/
concurrency
/
ReadWriteLockTest.java
diff --git
a/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java
b/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java
index d17b3d92fa66bc1bbfb9bce90437f54a4f48171c..4b4bd42628046dc34d2a24a378402dc9b828d1ea 100644
(file)
--- a/
support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java
+++ b/
support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java
@@
-15,7
+15,6
@@
*/
package org.wamblee.concurrency;
*/
package org.wamblee.concurrency;
-import junit.framework.Assert;
import junit.framework.TestCase;
/**
import junit.framework.TestCase;
/**
@@
-25,11
+24,11
@@
import junit.framework.TestCase;
* @see ReadWriteLock
*/
public class ReadWriteLockTest extends TestCase {
* @see ReadWriteLock
*/
public class ReadWriteLockTest extends TestCase {
- private static final int HALF_SECOND =
5
00;
+ private static final int HALF_SECOND =
1
00;
- private static final int ONE_SECOND =
10
00;
+ private static final int ONE_SECOND =
2
00;
- private static final int TWO_SECONDS =
20
00;
+ private static final int TWO_SECONDS =
4
00;
private ReadWriteLock lock;
private int nReaders;
private int nWriters;
private ReadWriteLock lock;
private int nReaders;
private int nWriters;
@@
-466,7
+465,7
@@
class ReadLocker implements Runnable {
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
-
Assert.fail
("ReadLocker thread was interrupted." +
+
throw new RuntimeException
("ReadLocker thread was interrupted." +
Thread.currentThread());
}
Thread.currentThread());
}
@@
-499,7
+498,7
@@
class WriteLocker implements Runnable {
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
try {
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
-
Assert.fail
("WriteLocker thread was interrupted: " +
+
throw new RuntimeException
("WriteLocker thread was interrupted: " +
Thread.currentThread());
}
Thread.currentThread());
}