Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deadlock issue in #50 #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix deadlock issue in #50 #61

wants to merge 1 commit into from

Conversation

elbakramer
Copy link

This addresses issue #50

Main idea is from @fxgendrin in the issue #50

Need a new release with following modification in AbstractClassLoader (as suggested in comment, but need to be compatible only with java 1.6, alternative is to duplicate ConcurrentSkipListSet into the project)
protected final Set<ProxyClassLoader> loaders = new ConcurrentSkipListSet<ProxyClassLoader>();

Besides the original proposal, there are some minor tweaks

  • Used backport implementation of java.util.concurrent in order to support java 1.5+, while some of the required classes are available since 1.6
  • To prevent loaders becoming Set from List, introduced thin wrapper(SetList) that wraps Set as List
  • Removed synchronized related codes/blocks because now java.util.concurrent handles the concurrent access/modification.

Checked that all existing tests are passing. But cannot think of a way to test properly that this really resolves the problem at hand.

Actually, my first choice was to ignore java 1.5+ support and just to use java.util.concurrent package. I tried that in my use case and it seemed to work as I expected.

@sandrocsimas
Copy link

The same problem here. It seems that the DEV is not active on this project anymore =(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants