Use CopyOnWriteArrayList for beforeCommit actions
Closes gh-27587
This commit is contained in:
parent
a2f2f7c348
commit
7271dfed68
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
package org.springframework.http.server.reactive;
|
package org.springframework.http.server.reactive;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
@ -69,7 +69,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
|
||||||
|
|
||||||
private final AtomicReference<State> state = new AtomicReference<>(State.NEW);
|
private final AtomicReference<State> state = new AtomicReference<>(State.NEW);
|
||||||
|
|
||||||
private final List<Supplier<? extends Mono<Void>>> commitActions = new ArrayList<>(4);
|
private final List<Supplier<? extends Mono<Void>>> commitActions = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private HttpHeaders readOnlyHeaders;
|
private HttpHeaders readOnlyHeaders;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue