This commit is contained in:
Jesper Wilhelmsson 2017-03-07 19:23:21 +01:00
commit 76e0d7cf28

View File

@ -588,6 +588,7 @@ public class SubmissionPublisher<T> implements Flow.Publisher<T>,
if (!closed) {
BufferedSubscription<T> b;
synchronized (this) {
// no need to re-check closed here
b = clients;
clients = null;
closed = true;
@ -619,9 +620,11 @@ public class SubmissionPublisher<T> implements Flow.Publisher<T>,
BufferedSubscription<T> b;
synchronized (this) {
b = clients;
clients = null;
closed = true;
closedException = error;
if (!closed) { // don't clobber racing close
clients = null;
closedException = error;
closed = true;
}
}
while (b != null) {
BufferedSubscription<T> next = b.next;