summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 08:49:33 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 08:49:33 +0000
commite7d19ebde89ca50807999eba062cfb2b47ac9337 (patch)
tree4496751ee3b889850c57721a65775cddec8cc422 /chrome
parent29581537f66b74e5b61f9834b30830e118cc0d85 (diff)
downloadchromium_src-e7d19ebde89ca50807999eba062cfb2b47ac9337.zip
chromium_src-e7d19ebde89ca50807999eba062cfb2b47ac9337.tar.gz
chromium_src-e7d19ebde89ca50807999eba062cfb2b47ac9337.tar.bz2
Annotate benign race in SyncherThread::IsSyncingCurrentlySilenced()
Example of TSan report is: WARNING: Possible data race during write of size 8 at 0xEBC2AF0: {{{ T24 (SyncEngine_SyncerThread) (locks held: {L780}): #0 base::TimeTicks::operator=(base::TimeTicks) base/time.h:442 #1 browser_sync::SyncerThread::SyncMain(browser_sync::Syncer*) chrome/browser/sync/engine/syncer_thread.cc:418 #2 browser_sync::SyncerThread::ThreadMainLoop() chrome/browser/sync/engine/syncer_thread.cc:288 #3 browser_sync::SyncerThread::ThreadMain() chrome/browser/sync/engine/syncer_thread.cc:408 #4 void DispatchToMethod<browser_sync::SyncerThread, void (browser_sync::SyncerThread::*)()>(browser_sync::SyncerThread*, void (browser_sync::SyncerThread::*)(), Tuple0 const&) base/tuple.h:412 ... Concurrent read(s) happened at (OR AFTER) these points: T0 (locks held: {}): #0 base::TimeTicks::operator-(base::TimeTicks) const base/time.h:447 #1 browser_sync::SyncerThread::IsSyncingCurrentlySilenced() chrome/browser/sync/engine/syncer_thread.cc:202 #2 browser_sync::SyncerThreadWithSyncerTest::WaitForThrottle() chrome/browser/sync/engine/syncer_thread_unittest.cc:81 #3 browser_sync::SyncerThreadWithSyncerTest_Throttling_Test::TestBody() chrome/browser/sync/engine/syncer_thread_unittest.cc:666 #4 testing::Test::Run() testing/gtest/src/gtest.cc:2095 }}} Review URL: http://codereview.chromium.org/1575007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index 4dc3cf8..08abf29 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -15,6 +15,7 @@
#include <map>
#include <queue>
+#include "base/dynamic_annotations.h"
#include "chrome/browser/sync/engine/auth_watcher.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
@@ -199,7 +200,12 @@ void SyncerThread::OnSilencedUntil(const base::TimeTicks& silenced_until) {
}
bool SyncerThread::IsSyncingCurrentlySilenced() {
- return (silenced_until_ - TimeTicks::Now()) >= TimeDelta::FromSeconds(0);
+ // We should ignore reads from silenced_until_ under ThreadSanitizer
+ // since this is a benign race.
+ ANNOTATE_IGNORE_READS_BEGIN();
+ bool ret = (silenced_until_ - TimeTicks::Now()) >= TimeDelta::FromSeconds(0);
+ ANNOTATE_IGNORE_READS_END();
+ return ret;
}
void SyncerThread::ThreadMainLoop() {