Skip to content

Commit

Permalink
Use macros for SequenceChecker docs.
Browse files Browse the repository at this point in the history
Macros are preferred to direct access to class methods, as they are less
expensive in production code.

BUG=689520
TEST=none
R=fdoray@chromium.org

Review-Url: https://codereview.chromium.org/2956033003
Cr-Commit-Position: refs/heads/master@{#482707}
  • Loading branch information
ishermandom authored and Commit Bot committed Jun 27, 2017
1 parent 1596dec commit 8c33b8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/threading_and_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ class A {
public:
A() {
// Do not require accesses to be on the creation sequence.
sequence_checker_.DetachFromSequence();
DETACH_FROM_SEQUENCE(sequence_checker_);
}
void AddValue(int v) {
// Check that all accesses are on the same sequence.
DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
values_.push_back(v);
}
private:
base::SequenceChecker sequence_checker_;
SEQUENCE_CHECKER(sequence_checker_);
// No lock required, because all accesses are on the
// same sequence.
Expand Down

0 comments on commit 8c33b8a

Please sign in to comment.