Exception in thread "Thread-56" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
at tak.Seek$1.run(Seek.java:78)
The problem comes from the iteration over seekListeners; As
documented,
a synchronizedSet still must be explicitly synchronized for iteration.
Instead of synchronizing, make a copy before spawning the thread, so
that mutations can occur on the canonical copy while the thread
dispatches notifications in the background.
I saw this in local testing:
The problem comes from the iteration over
seekListeners
; As documented, asynchronizedSet
still must be explicitly synchronized for iteration.Instead of synchronizing, make a copy before spawning the thread, so that mutations can occur on the canonical copy while the thread dispatches notifications in the background.