Netflix/Hystrix — pull request #189 by benjchristensen (2013-10-01 20:43:24+00:00)
Title: BugFix: Race condition between run() and timeout

This uses compareAndSet to synchronize timeout vs run() completion logic when there is a race.

I have not been able to to replicate the issue reported at https://github.com/Netflix/Hystrix/issues/188 but I can see how the existing code is vulnerable to a race condition. This theoretically should fix it. All unit tests pass for existing functionality. All my attempts to create a unit test to reveal the issue failed.