diff options
author | Nathan Myers <nathan.myers@10gen.com> | 2017-06-08 14:49:22 -0400 |
---|---|---|
committer | Nathan Myers <nathan.myers@10gen.com> | 2017-06-08 14:49:22 -0400 |
commit | b0948771201e479568dd8a8bed947d0f6166e5fb (patch) | |
tree | 6915e384142536a626d00a5317100ed20e023309 /src/mongo/db/concurrency | |
parent | 7c7267fb30c0c7f36d3622414be280081f128fa8 (diff) | |
download | mongo-b0948771201e479568dd8a8bed947d0f6166e5fb.tar.gz |
SERVER-29233 Sanitize MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN/_END
Diffstat (limited to 'src/mongo/db/concurrency')
-rw-r--r-- | src/mongo/db/concurrency/write_conflict_exception.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mongo/db/concurrency/write_conflict_exception.h b/src/mongo/db/concurrency/write_conflict_exception.h index c8b7b88d0b8..5a053502727 100644 --- a/src/mongo/db/concurrency/write_conflict_exception.h +++ b/src/mongo/db/concurrency/write_conflict_exception.h @@ -38,27 +38,27 @@ // Use of this macro is deprecated. Prefer the writeConflictRetry template, below, instead. -#define MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN \ - do { \ - int wcr__Attempts = 0; \ - do { \ +// clang-format off + +#define MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN \ + do { \ + int WCR_attempts = 0; \ + do { \ try -#define MONGO_WRITE_CONFLICT_RETRY_LOOP_END(PTXN, OPSTR, NSSTR) \ - catch (const ::mongo::WriteConflictException& wce) { \ - const OperationContext* ptxn = (PTXN); \ - ++CurOp::get(ptxn)->debug().writeConflicts; \ - wce.logAndBackoff(wcr__Attempts, (OPSTR), (NSSTR)); \ - ++wcr__Attempts; \ - ptxn->recoveryUnit()->abandonSnapshot(); \ - continue; \ - } \ - break; \ - } \ - while (true) \ - ; \ - } \ - while (false) \ - ; +#define MONGO_WRITE_CONFLICT_RETRY_LOOP_END(PTXN, OPSTR, NSSTR) \ + catch (const ::mongo::WriteConflictException& WCR_wce) { \ + OperationContext const* WCR_opCtx = (PTXN); \ + ++CurOp::get(WCR_opCtx)->debug().writeConflicts; \ + WCR_wce.logAndBackoff(WCR_attempts, (OPSTR), (NSSTR)); \ + ++WCR_attempts; \ + WCR_opCtx->recoveryUnit()->abandonSnapshot(); \ + continue; \ + } \ + break; \ + } while (true); \ + } while (false) + +// clang-format on namespace mongo { |