tsan: Suppress a benign race in icu.
tsan: Suppress a benign race in icu.

TSAN reports:

==31254== INFO: T0 is program's main thread
==31254== INFO: T302 has been created by T0 at this point: {{{
==31254==     #0  (no symbols) /lib/tls/i686/cmov/libpthread-2.7.so
==31254==     #1  pthread_create@@GLIBC_2.1 /lib/tls/i686/cmov/libpthread-2.7.so
==31254==     #2  pthread_create@* /tmp/valgrind-src/tsan/tsan/ts_valgrind_intercepts.c:732
==31254==     #3  base::::CreateThread base/threading/platform_thread_posix.cc:109
==31254==     #4  base::PlatformThread::Create base/threading/platform_thread_posix.cc:204
==31254==     #5  base::Thread::StartWithOptions base/threading/thread.cc:74
==31254==     #6  base::Thread::Start base/threading/thread.cc:63
==31254==     #7  HistoryService::Init chrome/browser/history/history.cc:664
==31254==     #8  TestingProfile::CreateHistoryService chrome/test/testing_profile.cc:228
==31254==     #9  HistoryURLProviderTest::SetUpImpl chrome/browser/autocomplete/history_url_provider_unittest.cc:155
==31254==     #10 HistoryURLProviderTest::SetUp chrome/browser/autocomplete/history_url_provider_unittest.cc:112
==31254==     #11 testing::internal::HandleSehExceptionsInMethodIfSupported testing/gtest/src/gtest.cc:2090
==31254==     #12 testing::internal::HandleExceptionsInMethodIfSupported testing/gtest/src/gtest.cc:2142
==31254==     #13 testing::Test::Run testing/gtest/src/gtest.cc:2157
==31254== }}}
==31254== WARNING: Possible data race during write of size 4 at 0xC159460: {{{
==31254==    T0 (L{}):
==31254==     #0  ucln_registerCleanup_46 third_party/icu/source/common/ucln_cmn.c:89
==31254==     #1  uplug_init_46 third_party/icu/source/common/icuplug.c:824
==31254==     #2  u_init_46 third_party/icu/source/common/uinit.c:63
==31254==     #3  icu_46::RegexPattern::RegexPattern third_party/icu/source/i18n/repattrn.cpp:34
==31254==     #4  icu_46::RegexPattern::compile third_party/icu/source/i18n/repattrn.cpp:296
==31254==     #5  icu_46::RegexMatcher::RegexMatcher third_party/icu/source/i18n/rematch.cpp:136
==31254==     #6  net::::IsIDNComponentSafe net/base/net_util.cc:570
==31254==     #7  net::::IDNToUnicodeOneComponent net/base/net_util.cc:643
==31254==     #8  net::::IDNToUnicodeWithOffsets net/base/net_util.cc:705
==31254==     #9  net::::HostComponentTransform::Execute net/base/net_util.cc:856
==31254==     #10 net::::AppendFormattedComponent net/base/net_util.cc:899
==31254==     #11 net::FormatUrlWithOffsets net/base/net_util.cc:1644
==31254==     #12 net::FormatUrl net/base/net_util.cc:1727
==31254==     #13 history::InMemoryURLIndex::IndexRow chrome/browser/history/in_memory_url_index.cc:166
==31254==     #14 history::InMemoryURLIndex::UpdateURL chrome/browser/history/in_memory_url_index.cc:309
==31254==     #15 history::InMemoryHistoryBackend::OnTypedURLsModified chrome/browser/history/in_memory_history_backend.cc:134
==31254==     #16 history::InMemoryHistoryBackend::Observe chrome/browser/history/in_memory_history_backend.cc:100
==31254==     #17 NotificationService::Notify content/common/notification_service.cc:120
==31254==     #18 HistoryService::BroadcastNotifications chrome/browser/history/history.cc:772
==31254==     #19 DispatchToMethod base/tuple.h:558
==31254==     #20 RunnableMethod::Run base/task.h:332
==31254==     #21 ::TaskClosureAdapter::Run base/message_loop.cc:100
==31254==     #22 base::internal::Invoker1::DoInvoke base/bind_internal.h:487
==31254==     #23 base::Callback::Run base/callback.h:251
==31254==     #24 MessageLoop::RunTask base/message_loop.cc:462
==31254==     #25 MessageLoop::DeferOrRunPendingTask base/message_loop.cc:480
==31254==     #26 MessageLoop::DoWork base/message_loop.cc:670
==31254==     #27 base::MessagePumpForUI::HandleDispatch base/message_pump_glib.cc:284
==31254==     #28 ::WorkSourceDispatch base/message_pump_glib.cc:109
==31254==     #29 g_main_context_dispatch /build/buildd/glib2.0-2.16.6/glib/gmain.c:2012
==31254==   Concurrent write(s) happened at (OR AFTER) these points:
==31254==    T302 (Chrome_HistoryThread) (L{}):
==31254==     #0  ucln_registerCleanup_46 third_party/icu/source/common/ucln_cmn.c:89
==31254==     #1  uplug_init_46 third_party/icu/source/common/icuplug.c:824
==31254==     #2  u_init_46 third_party/icu/source/common/uinit.c:63
==31254==     #3  icu_46::RegexPattern::RegexPattern third_party/icu/source/i18n/repattrn.cpp:34
==31254==     #4  icu_46::RegexPattern::compile third_party/icu/source/i18n/repattrn.cpp:296
==31254==     #5  icu_46::RegexMatcher::RegexMatcher third_party/icu/source/i18n/rematch.cpp:136
==31254==     #6  net::::IsIDNComponentSafe net/base/net_util.cc:570
==31254==     #7  net::::IDNToUnicodeOneComponent net/base/net_util.cc:643
==31254==     #8  net::::IDNToUnicodeWithOffsets net/base/net_util.cc:705
==31254==     #9  net::::HostComponentTransform::Execute net/base/net_util.cc:856
==31254==   Address 0xC159460 is 0 bytes inside data symbol "gLibCleanupFunctions"
==31254==    Race verifier data: 0x965D965,0x965D962
==31254== }}}

uplug_init_46() calls ucln_registerCleanup(UCLN_UPLUG, uplug_cleanup) concurrently on two threads, and both treads write uplug_cleanup into gLibCleanupFunctions. This should be safe.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7023002

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@85384 0039d316-1c4b-4281-b951-d872f2087c98

yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,ropik/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,ropik/chromium,ropik/chromium