ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jdk8/java/util/concurrent/SubmissionPublisher.java
(Generate patch)

Comparing jsr166/src/jdk8/java/util/concurrent/SubmissionPublisher.java (file contents):
Revision 1.5 by jsr166, Sat Dec 17 22:16:15 2016 UTC vs.
Revision 1.6 by jsr166, Sat Mar 11 00:17:04 2017 UTC

# Line 556 | Line 556 | public class SubmissionPublisher<T> impl
556          if (!closed) {
557              BufferedSubscription<T> b;
558              synchronized (this) {
559 +                // no need to re-check closed here
560                  b = clients;
561                  clients = null;
562                  closed = true;
# Line 587 | Line 588 | public class SubmissionPublisher<T> impl
588              BufferedSubscription<T> b;
589              synchronized (this) {
590                  b = clients;
591 <                clients = null;
592 <                closed = true;
593 <                closedException = error;
591 >                if (!closed) {  // don't clobber racing close
592 >                    clients = null;
593 >                    closedException = error;
594 >                    closed = true;
595 >                }
596              }
597              while (b != null) {
598                  BufferedSubscription<T> next = b.next;
# Line 1333 | Line 1336 | public class SubmissionPublisher<T> impl
1336                      }
1337                  }
1338              }
1339 <            else if (n < 0L)
1339 >            else
1340                  onError(new IllegalArgumentException(
1341 <                            "negative subscription request"));
1341 >                            "non-positive subscription request"));
1342          }
1343  
1344          public final boolean isReleasable() { // for ManagedBlocker

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines