Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: base/threading/thread_local_storage_unittest.cc

Issue 2363783002: Add Reclaim Support to ThreadLocalStorage (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/threading/thread_local_storage.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #include <process.h> 7 #include <process.h>
8 #endif 8 #endif
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 threads[index]->Join(); 120 threads[index]->Join();
121 delete threads[index]; 121 delete threads[index];
122 delete thread_delegates[index]; 122 delete thread_delegates[index];
123 123
124 // Verify that the destructor was called and that we reset. 124 // Verify that the destructor was called and that we reset.
125 EXPECT_EQ(values[index], kFinalTlsValue); 125 EXPECT_EQ(values[index], kFinalTlsValue);
126 } 126 }
127 tls_slot.Free(); // Stop doing callbacks to cleanup threads. 127 tls_slot.Free(); // Stop doing callbacks to cleanup threads.
128 } 128 }
129 129
130 TEST(ThreadLocalStorageTest, TLSReclaim) {
131 // Creates and destroys many TLS slots.
132 for (int i = 0; i < 1000; ++i) {
133 ThreadLocalStorage::Slot slot(nullptr);
134 }
135 }
136
130 } // namespace base 137 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_local_storage.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698