Integrated: 8267990: Revisit some uses of `synchronized` in the HttpClient API

Daniel Fuchs dfuchs at openjdk.java.net
Tue Jun 1 17:13:24 UTC 2021


On Mon, 31 May 2021 16:21:29 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> The Utils.remaining(List<ByteBuffer> list) method assumes that it can and should synchronize on the given list to prevent concurrent modification. In 99% of the cases this assumption is wrong. There's only one such list (the SSLFlowDelegate writeList) that requires this synchronization. 
> 
> Also the `SequentialScheduler.synchronizedScheduler` uses `synchronized`, it could use a Lock instead and this would make it possible to assert that there is no contention (since the logic of the SequentialScheduler is supposed to prevent contention from occurring at this place).

This pull request has now been integrated.

Changeset: 9d8ad2ed
Author:    Daniel Fuchs <dfuchs at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/9d8ad2ed62325bd8d813974d5aa1e031ed8bf8da
Stats:     105 lines in 13 files changed: 62 ins; 6 del; 37 mod

8267990: Revisit some uses of `synchronized` in the HttpClient API

Reviewed-by: chegar

-------------

PR: https://git.openjdk.java.net/jdk/pull/4275


More information about the net-dev mailing list