excilys/androidannotations — pull request #624 by rom1v (2013-06-10 12:56:02+00:00)
Title: Serialized @Background task cancellation bugfix

This pull request fix a bug found in my [serial+cancellable tasks feature](https://github.com/excilys/androidannotations/pull/569).

If a serialized `@Background` task was cancelled after it had been
submitted to the executor but before its `run()` method was called, then
the following tasks with the same serial identifier were not executed.

Issue reported here:
https://github.com/excilys/androidannotations/pull/579#issuecomment-19173978

Detected by `ThreadActivityTest#cancellableSerializedBackgroundTasks()`
(but not always due to the race condition)

I ran the tests 50 times (in a loop):
* 24 fails without this fix
* 0 fails with this fix

Thank you to [dhleong](https://github.com/excilys/androidannotations/pull/579#issuecomment-19173978) for reporting it so quickly after the merge.