Improved onlyIf atomicity test