You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Override was probably misleading. A better term would be probably be preventsrequested being set to Long.MAX_VALUE. I was referring to the code below from Subscriber where if a request(0) does nothing but return (doesn't set requested to 0) then requested can end up as Long.MAX_VALUE.
publicvoidsetProducer(Producerproducer) {
longtoRequest;
booleansetProducer = false;
synchronized (this) {
toRequest = requested;
p = producer;
if (op != null) {
// middle operator ... we pass thru unless a request has been madeif (toRequest == Long.MIN_VALUE) {
// we pass-thru to the next producer as nothing has been requestedsetProducer = true;
}
}
}
// do after releasing lockif (setProducer) {
op.setProducer(p);
} else {
// we execute the request with whatever has been requested (or Long.MAX_VALUE)if (toRequest == Long.MIN_VALUE) {
p.request(Long.MAX_VALUE);
} else {
p.request(toRequest);
}
}
}
For a
Subscriber
without aProducer
, callingdoes not give 5 requests but 3 only. Shouldn't this be additive? (or at least documented that it is not).
The text was updated successfully, but these errors were encountered: