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

Comparing jsr166/src/main/java/util/concurrent/SubmissionPublisher.java (file contents):
Revision 1.36 by dl, Wed Jul 29 23:37:23 2015 UTC vs.
Revision 1.37 by dl, Mon Aug 3 15:06:44 2015 UTC

# Line 163 | Line 163 | public class SubmissionPublisher<T> impl
163      /** Run status, updated only within locks */
164      volatile boolean closed;
165      /** If non-null, the exception in closeExceptionally */
166 <    Throwable closeException;
166 >    volatile Throwable closedException;
167  
168      // Parameters for constructing BufferedSubscriptions
169      final Executor executor;
# Line 261 | Line 261 | public class SubmissionPublisher<T> impl
261                  if (b == null) {
262                      Throwable ex;
263                      subscription.onSubscribe();
264 <                    if ((ex = closeException) != null)
264 >                    if ((ex = closedException) != null)
265                          subscription.onError(ex);
266                      else if (closed)
267                          subscription.onComplete();
# Line 558 | Line 558 | public class SubmissionPublisher<T> impl
558                  b = clients;
559                  clients = null;
560                  closed = true;
561 <                closeException = error;
561 >                closedException = error;
562              }
563              while (b != null) {
564                  BufferedSubscription<T> next = b.next;
# Line 578 | Line 578 | public class SubmissionPublisher<T> impl
578          return closed;
579      }
580  
581 +
582 +    /**
583 +     * Returns the exception associated with {@link #closeExceptionally},
584 +     * or null if not closed or if closed normally.
585 +     *
586 +     * @return the exception, or null if none
587 +     */
588 +    public Throwable getClosedException() {
589 +        return closedException;
590 +    }
591 +
592      /**
593       * Returns true if this publisher has any subscribers.
594       *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines