This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Possible to have ConcurrentModificationException with multiple threads?

V Pinto
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Given the following code

Given that at any time an external thread can call remMethod() will I ever get a ConcurrentModificationException regarding the iterator it? I made the current thread to get the lock over the hash object when iterating so, in my understanding, even if an external thread tries to run remMethod() while iterating, wont be possible to get such an exception... I'm missing something?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic