commit | 70689ead18d574104d3a8a75bdfc3daf03b2b2cb | [log] [tgz] |
---|---|---|
author | David Reiss <dreiss@fb.com> | Thu Oct 17 19:16:08 2013 -0700 |
committer | Michael Bolin <mbolin@fb.com> | Thu Oct 24 20:58:12 2013 -0700 |
tree | 6cf40e1cbb0de3b8ff79995372b9ad9e4d0a187c | |
parent | a206a10211b61e2f1a1ac59760893a088e16fd30 [diff] |
Make MoreFutures.isSuccess not throw when it is interrupted. Summary: It's possible for a future (like Guava's AbstractFuture) to return true from isDone but still throw an InterruptedException from get() if the current thread has been interrupted. The old code threw a RuntimeException in this case, which was unnecessary. Change it to just retry and reset the thread interrupt status instead. This solution was informed by the "Noncancelable tasks" section of http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html Test Plan: Unit tests. The new test failed 5 out of 5 times on the old code on my machine, but it could pass spuriously (without the doNotOptimizeMe loop, it was passing about 50% of the time). With the new code, it should pass deterministically.
Buck is an Android build tool. To see what Buck can do for you, check out the documentation at http://facebook.github.io/buck/.
To build Buck, run the following:
git clone git@github.com:facebook/buck.git cd buck ant ./bin/buck --help
Apache License 2.0