chapel-lang/chapel — pull request #719 by lydia-duncan (2014-10-30 21:36:16+00:00)
Title: Fix a race in studies/jacobi/waynew/example2.chpl

This test had been very rarely generating incorrect output due to failing to
detect that sufficient change had occurred between late passes. This happened
because the variable used to determine if sufficient change had occurred was
being updated by all running tasks without locking, so there was a race. Since
we don't support atomic |= for booleans, I replaced the boolean with an atomic
integer, and the |= call with atomically adding the old boolean check (so if
the result of comparing the new and old values was above the tolerance for a
change, then an integer representation of true would be added). After 150 runs,
it appears that this has solved the problem (100 runs was sufficient to see 6
failures in this manner with fifo before this change).