Chromium Code Reviews| Index: webrtc/base/race_checker.cc |
| diff --git a/webrtc/base/race_checker.cc b/webrtc/base/race_checker.cc |
| index 9f0946ca76f87e1386219b21f8073676f3497a00..96bb6cce7bb827e64af6991d304edbe5342a12a6 100644 |
| --- a/webrtc/base/race_checker.cc |
| +++ b/webrtc/base/race_checker.cc |
| @@ -14,6 +14,12 @@ namespace rtc { |
| RaceChecker::RaceChecker() {} |
| +// Note that the implementation here is in itself racy, but we pretend it does |
| +// not matter because we want this useful in release builds without having to |
| +// pay the cost of using atomics. A race hitting the race checker is likely to |
| +// cause access_count_ to diverge from zero and therefore cause the ThreadRef |
| +// comparison to fail, signaling a race, although it may not be in the exact |
| +// spot where a race *first* appeared in the code we're trying to protect. |
|
kwiberg-webrtc
2016/09/22 20:12:17
Maybe not that it's known that a race may also cau
|
| bool RaceChecker::Acquire() const { |
| const PlatformThreadRef current_thread = CurrentThreadRef(); |
| // Set new accessing thread if this is a new use. |