From fa87a2527ca8c0bcef92d8e44791332782936911 Mon Sep 17 00:00:00 2001 From: "evanm@google.com" Date: Wed, 20 Aug 2008 22:11:47 +0000 Subject: Revert. Failing unit tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98 --- base/stats_table.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'base/stats_table.cc') diff --git a/base/stats_table.cc b/base/stats_table.cc index 8b10662..23c736a 100644 --- a/base/stats_table.cc +++ b/base/stats_table.cc @@ -254,7 +254,7 @@ StatsTable* StatsTable::global_table_ = NULL; StatsTable::StatsTable(const std::wstring& name, int max_threads, int max_counters) - : tls_index_(SlotReturnFunction) { + : tls_index_(ThreadLocalStorage::Alloc(SlotReturnFunction)) { int table_size = AlignedSize(sizeof(TableHeader)) + AlignedSize((max_counters * sizeof(wchar_t) * kMaxCounterNameLength)) + @@ -285,7 +285,7 @@ StatsTable::~StatsTable() { // Return ThreadLocalStorage. At this point, if any registered threads // still exist, they cannot Unregister. - tls_index_.Free(); + ThreadLocalStorage::Free(tls_index_); // Cleanup our shared memory. delete impl_; @@ -329,13 +329,13 @@ int StatsTable::RegisterThread(const std::wstring& name) { StatsTableTLSData* data = new StatsTableTLSData; data->table = this; data->slot = slot; - tls_index_.Set(data); + ThreadLocalStorage::Set(tls_index_, data); return slot; } StatsTableTLSData* StatsTable::GetTLSData() const { StatsTableTLSData* data = - static_cast(tls_index_.Get()); + static_cast(ThreadLocalStorage::Get(tls_index_)); if (!data) return NULL; @@ -355,7 +355,7 @@ void StatsTable::UnregisterThread() { *name = L'\0'; // Remove the calling thread's TLS so that it cannot use the slot. - tls_index_.Set(NULL); + ThreadLocalStorage::Set(tls_index_, NULL); delete data; } -- cgit v1.1