mozilla-services/android-sync — comment on commit 74ecea1f3f74cd54f1e9a1eebe8c16d1b176a1be
File: test/src/org/mozilla/android/sync/test/WaitHelperTest.java line 148
By rnewman:

Two separate atomics aren't atomic in aggregate.

I understand that you only set one at a time inside the code that you intend to be concurrent, but given that this test is supposed to be verifying the safety of that concurrent code, I'd prefer the following:

• Guard both with the same monitor, or control access via a synchronized block on the test object (same thing, really). Given that they're guarded, they no longer need to be atomic.
• Provide a synchronized assertion that tests — and sets, if necessary — both values.
• Don't access them directly; only through a synchronized method or a synchronized block on the correct monitor.