On Thu, 23 Feb 2023 12:35:39 GMT, Daniel Fuchs <[email protected]> wrote:
>> Daniel Jeliński has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Remove unnecessary lock
>
> src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java line 321:
>
>> 319: /* return a still valid, idle HttpClient */
>> 320: HttpClient get() {
>> 321: // check the most recent connection, use if still valid
>
> It might be prudent to assert that the global cacheLock is held by the
> current thread in get & put (if that's feasible without too much hackery).
> Just worrying about future maintainers possibly modifying this code and using
> ClientVector outside of the lock. The assert would make sure they ponder the
> consequences.
Asserts added; let me know if the amount of hackery involved looks acceptable.
-------------
PR: https://git.openjdk.org/jdk/pull/12676