| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project 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 #include "src/base/platform/platform.h" | 5 #include "src/base/platform/platform.h" |
| 6 | 6 |
| 7 #if V8_OS_POSIX | 7 #if V8_OS_POSIX |
| 8 #include <unistd.h> // NOLINT | 8 #include <unistd.h> // NOLINT |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #if V8_OS_WIN | 30 #if V8_OS_WIN |
| 31 EXPECT_EQ(static_cast<int>(::GetCurrentProcessId()), | 31 EXPECT_EQ(static_cast<int>(::GetCurrentProcessId()), |
| 32 OS::GetCurrentProcessId()); | 32 OS::GetCurrentProcessId()); |
| 33 #endif | 33 #endif |
| 34 } | 34 } |
| 35 | 35 |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class SelfJoinThread FINAL : public Thread { | |
| 40 public: | |
| 41 SelfJoinThread() : Thread(Options("SelfJoinThread")) {} | |
| 42 void Run() FINAL { Join(); } | |
| 43 }; | |
| 44 | |
| 45 } // namespace | |
| 46 | |
| 47 | |
| 48 TEST(Thread, DISABLE_ON_ANDROID(SelfJoin)) { | |
| 49 SelfJoinThread thread; | |
| 50 thread.Start(); | |
| 51 thread.Join(); | |
| 52 } | |
| 53 | |
| 54 | |
| 55 namespace { | |
| 56 | |
| 57 class ThreadLocalStorageTest : public Thread, public ::testing::Test { | 39 class ThreadLocalStorageTest : public Thread, public ::testing::Test { |
| 58 public: | 40 public: |
| 59 ThreadLocalStorageTest() : Thread(Options("ThreadLocalStorageTest")) { | 41 ThreadLocalStorageTest() : Thread(Options("ThreadLocalStorageTest")) { |
| 60 for (size_t i = 0; i < arraysize(keys_); ++i) { | 42 for (size_t i = 0; i < arraysize(keys_); ++i) { |
| 61 keys_[i] = Thread::CreateThreadLocalKey(); | 43 keys_[i] = Thread::CreateThreadLocalKey(); |
| 62 } | 44 } |
| 63 } | 45 } |
| 64 ~ThreadLocalStorageTest() { | 46 ~ThreadLocalStorageTest() { |
| 65 for (size_t i = 0; i < arraysize(keys_); ++i) { | 47 for (size_t i = 0; i < arraysize(keys_); ++i) { |
| 66 Thread::DeleteThreadLocalKey(keys_[i]); | 48 Thread::DeleteThreadLocalKey(keys_[i]); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 91 |
| 110 | 92 |
| 111 TEST_F(ThreadLocalStorageTest, DoTest) { | 93 TEST_F(ThreadLocalStorageTest, DoTest) { |
| 112 Run(); | 94 Run(); |
| 113 Start(); | 95 Start(); |
| 114 Join(); | 96 Join(); |
| 115 } | 97 } |
| 116 | 98 |
| 117 } // namespace base | 99 } // namespace base |
| 118 } // namespace v8 | 100 } // namespace v8 |
| OLD | NEW |