equal
deleted
inserted
replaced
429 /** |
429 /** |
430 * Cancelling a subscription eventually causes no more onNexts to be issued |
430 * Cancelling a subscription eventually causes no more onNexts to be issued |
431 */ |
431 */ |
432 public void testCancel() { |
432 public void testCancel() { |
433 SubmissionPublisher<Integer> p = |
433 SubmissionPublisher<Integer> p = |
434 new SubmissionPublisher<Integer>(basicExecutor, 4); // must be < 20 |
434 new SubmissionPublisher<>(basicExecutor, 4); // must be < 20 |
435 TestSubscriber s1 = new TestSubscriber(); |
435 TestSubscriber s1 = new TestSubscriber(); |
436 TestSubscriber s2 = new TestSubscriber(); |
436 TestSubscriber s2 = new TestSubscriber(); |
437 p.subscribe(s1); |
437 p.subscribe(s1); |
438 p.subscribe(s2); |
438 p.subscribe(s2); |
439 s1.awaitSubscribe(); |
439 s1.awaitSubscribe(); |
1010 * Tests scenario for |
1010 * Tests scenario for |
1011 * JDK-8187947: A race condition in SubmissionPublisher |
1011 * JDK-8187947: A race condition in SubmissionPublisher |
1012 * cvs update -D '2017-11-25' src/main/java/util/concurrent/SubmissionPublisher.java && ant -Djsr166.expensiveTests=true -Djsr166.tckTestClass=SubmissionPublisherTest -Djsr166.methodFilter=testMissedSignal tck; cvs update -A src/main/java/util/concurrent/SubmissionPublisher.java |
1012 * cvs update -D '2017-11-25' src/main/java/util/concurrent/SubmissionPublisher.java && ant -Djsr166.expensiveTests=true -Djsr166.tckTestClass=SubmissionPublisherTest -Djsr166.methodFilter=testMissedSignal tck; cvs update -A src/main/java/util/concurrent/SubmissionPublisher.java |
1013 */ |
1013 */ |
1014 public void testMissedSignal_8187947() throws Exception { |
1014 public void testMissedSignal_8187947() throws Exception { |
|
1015 if (!atLeastJava9()) return; // backport to jdk8 too hard |
1015 final int N = expensiveTests ? (1 << 20) : (1 << 10); |
1016 final int N = expensiveTests ? (1 << 20) : (1 << 10); |
1016 final CountDownLatch finished = new CountDownLatch(1); |
1017 final CountDownLatch finished = new CountDownLatch(1); |
1017 final SubmissionPublisher<Boolean> pub = new SubmissionPublisher<>(); |
1018 final SubmissionPublisher<Boolean> pub = new SubmissionPublisher<>(); |
1018 class Sub implements Subscriber<Boolean> { |
1019 class Sub implements Subscriber<Boolean> { |
1019 int received; |
1020 int received; |