Skip to content

Commit

Permalink
synchronize access to subscription for null check in OperatorMulticast
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoten committed Sep 28, 2014
1 parent eb6ae37 commit b8da4a9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ public void call() {
}));

// now that everything is hooked up let's subscribe
if (subscription!=null)
source.unsafeSubscribe(subscription);
// as long as the subscription is not null
boolean subscriptionIsNull;
synchronized(guard) {
subscriptionIsNull = subscription == null;
}
if (!subscriptionIsNull)
source.unsafeSubscribe(subscription);
}
}
}

0 comments on commit b8da4a9

Please sign in to comment.