OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/simple_thread.h" | 10 #include "base/threading/simple_thread.h" |
11 #include "base/thread_local_storage.h" | 11 #include "base/thread_local_storage.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
15 // Ignore warnings about ptr->int conversions that we use when | 15 // Ignore warnings about ptr->int conversions that we use when |
16 // storing ints into ThreadLocalStorage. | 16 // storing ints into ThreadLocalStorage. |
17 #pragma warning(disable : 4311 4312) | 17 #pragma warning(disable : 4311 4312) |
18 #endif | 18 #endif |
19 | 19 |
20 const int kInitialTlsValue = 0x5555; | 20 const int kInitialTlsValue = 0x5555; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Wait for the threads to finish. | 85 // Wait for the threads to finish. |
86 for (int index = 0; index < kNumThreads; index++) { | 86 for (int index = 0; index < kNumThreads; index++) { |
87 threads[index]->Join(); | 87 threads[index]->Join(); |
88 delete threads[index]; | 88 delete threads[index]; |
89 delete thread_delegates[index]; | 89 delete thread_delegates[index]; |
90 | 90 |
91 // Verify that the destructor was called and that we reset. | 91 // Verify that the destructor was called and that we reset. |
92 EXPECT_EQ(values[index], kInitialTlsValue); | 92 EXPECT_EQ(values[index], kInitialTlsValue); |
93 } | 93 } |
94 } | 94 } |
OLD | NEW |