Double-checked lock in ChannelSendOperator#request
Closes gh-31865
This commit is contained in:
parent
2a43cc7574
commit
47779d6a53
|
@ -281,6 +281,10 @@ class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
if (this.state == State.READY_TO_WRITE) {
|
||||||
|
s.request(n);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.writeSubscriber != null) {
|
if (this.writeSubscriber != null) {
|
||||||
if (this.state == State.EMITTING_CACHED_SIGNALS) {
|
if (this.state == State.EMITTING_CACHED_SIGNALS) {
|
||||||
this.demandBeforeReadyToWrite = n;
|
this.demandBeforeReadyToWrite = n;
|
||||||
|
|
|
@ -273,6 +273,10 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
if (this.state == State.READY_TO_WRITE) {
|
||||||
|
s.request(n);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.writeSubscriber != null) {
|
if (this.writeSubscriber != null) {
|
||||||
if (this.state == State.EMITTING_CACHED_SIGNALS) {
|
if (this.state == State.EMITTING_CACHED_SIGNALS) {
|
||||||
this.demandBeforeReadyToWrite = n;
|
this.demandBeforeReadyToWrite = n;
|
||||||
|
|
Loading…
Reference in New Issue