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