| OLD | NEW |
| 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/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 11 #include "base/threading/thread_local_storage.h" | 12 #include "base/threading/thread_local_storage.h" |
| 13 #include "build/build_config.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 15 |
| 14 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 15 // Ignore warnings about ptr->int conversions that we use when | 17 // Ignore warnings about ptr->int conversions that we use when |
| 16 // storing ints into ThreadLocalStorage. | 18 // storing ints into ThreadLocalStorage. |
| 17 #pragma warning(disable : 4311 4312) | 19 #pragma warning(disable : 4311 4312) |
| 18 #endif | 20 #endif |
| 19 | 21 |
| 20 namespace base { | 22 namespace base { |
| 21 | 23 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 delete threads[index]; | 121 delete threads[index]; |
| 120 delete thread_delegates[index]; | 122 delete thread_delegates[index]; |
| 121 | 123 |
| 122 // Verify that the destructor was called and that we reset. | 124 // Verify that the destructor was called and that we reset. |
| 123 EXPECT_EQ(values[index], kFinalTlsValue); | 125 EXPECT_EQ(values[index], kFinalTlsValue); |
| 124 } | 126 } |
| 125 tls_slot.Free(); // Stop doing callbacks to cleanup threads. | 127 tls_slot.Free(); // Stop doing callbacks to cleanup threads. |
| 126 } | 128 } |
| 127 | 129 |
| 128 } // namespace base | 130 } // namespace base |
| OLD | NEW |