| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" // NOLINT | 5 #include "platform/globals.h" // NOLINT |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/os_thread.h" | 8 #include "vm/os_thread.h" |
| 9 | 9 |
| 10 #include <process.h> // NOLINT | 10 #include <process.h> // NOLINT |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // Close the handle, so we don't leak the thread object. | 66 // Close the handle, so we don't leak the thread object. |
| 67 CloseHandle(reinterpret_cast<HANDLE>(thread)); | 67 CloseHandle(reinterpret_cast<HANDLE>(thread)); |
| 68 | 68 |
| 69 return 0; | 69 return 0; |
| 70 } | 70 } |
| 71 | 71 |
| 72 ThreadLocalKey OSThread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES; | 72 ThreadLocalKey OSThread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES; |
| 73 ThreadId OSThread::kInvalidThreadId = 0; | 73 ThreadId OSThread::kInvalidThreadId = 0; |
| 74 | 74 |
| 75 ThreadLocalKey OSThread::CreateThreadLocal() { | 75 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor unused) { |
| 76 ThreadLocalKey key = TlsAlloc(); | 76 ThreadLocalKey key = TlsAlloc(); |
| 77 if (key == kUnsetThreadLocalKey) { | 77 if (key == kUnsetThreadLocalKey) { |
| 78 FATAL1("TlsAlloc failed %d", GetLastError()); | 78 FATAL1("TlsAlloc failed %d", GetLastError()); |
| 79 } | 79 } |
| 80 return key; | 80 return key; |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void OSThread::DeleteThreadLocal(ThreadLocalKey key) { | 84 void OSThread::DeleteThreadLocal(ThreadLocalKey key) { |
| 85 ASSERT(key != kUnsetThreadLocalKey); | 85 ASSERT(key != kUnsetThreadLocalKey); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // timeout before we signal it, that object will get an extra | 451 // timeout before we signal it, that object will get an extra |
| 452 // signal. This will be treated as a spurious wake-up and is OK | 452 // signal. This will be treated as a spurious wake-up and is OK |
| 453 // since all uses of monitors should recheck the condition after a | 453 // since all uses of monitors should recheck the condition after a |
| 454 // Wait. | 454 // Wait. |
| 455 data_.SignalAndRemoveAllWaiters(); | 455 data_.SignalAndRemoveAllWaiters(); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace dart | 458 } // namespace dart |
| 459 | 459 |
| 460 #endif // defined(TARGET_OS_WINDOWS) | 460 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |