On Mon, 7 Nov 2022 18:29:56 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> I traced it down to this: Is this why it's already synchronized ? >> appendClassPath -> ucp.addFile -> addURL >> public synchronized void addURL(URL url) { >> if (closed || url == null) >> return; >> synchronized (unopenedUrls) { >> if (! path.contains(url)) { >> unopenedUrls.addLast(url); >> path.add(url); >> } >> } >> } > > Yes, URLClassPath is already synchronized. I'm not 100% sure why the > ObjectLocker is there but it's possible to pre-dates parallel capable class > loaders so it dates from a time when findClass/loadClass were synchronized on > "this". Yes, the code's been there for forever. Thanks! ------------- PR: https://git.openjdk.org/jdk/pull/11023