Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

FIXED ConcurrentModificationException when adding a request listener to a request that's firing updates #140

Conversation

softwaremaverick
Copy link
Collaborator

No description provided.

stephanenicolas added a commit that referenced this pull request Jul 11, 2013
…ption

FIXED ConcurrentModificationException when adding a request listener to a request that's firing updates
@stephanenicolas stephanenicolas merged commit 8a14278 into stephanenicolas:master Jul 11, 2013
@stephanenicolas
Copy link
Owner

Really nice piece of code. Personnally, I don't know how to unit test something like this in a predictible way.

You have any test to submit, please go ahead. Eager to see other patches, this one is really neat.

@softwaremaverick softwaremaverick deleted the fix-concurrent-mod-exception branch July 11, 2013 20:50
@softwaremaverick
Copy link
Collaborator Author

Thanks. I fix them as I find them.

@softwaremaverick
Copy link
Collaborator Author

Oh and as for unit testing it. I imagine that two threads running where one is iterating over the request listeners but where a request listener is purposely slow, whilst another addListenerIfPending request is happening should pretty much do it.

@stephanenicolas
Copy link
Owner

I agree but that would not be predictable. Multiple loops (I mean a large
one with many iterations) could help to get more "predictable"...

The best way could that a listener that is being fired itself modifies the
list of listeners it belongs to. That would get predictable.
WDYT ?

2013/7/11 softwaremaverick [email protected]

Oh and as for unit testing it. I imagine that two threads running where
one is iterating over the request listeners but where a request listener is
purposely slow, whilst another addListenerIfPending request is happening
should pretty much do it.


Reply to this email directly or view it on GitHubhttps://github.com//pull/140#issuecomment-20841491
.

Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - blog.octo.com
www.usievents.com
...........................................................

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

Successfully merging this pull request may close these issues.

2 participants