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" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
7 | 7 |
8 #include "bin/thread.h" | 8 #include "bin/thread.h" |
9 | 9 |
10 #include <process.h> // NOLINT | 10 #include <process.h> // NOLINT |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #endif | 63 #endif |
64 return errno; | 64 return errno; |
65 } | 65 } |
66 | 66 |
67 // Close the handle, so we don't leak the thread object. | 67 // Close the handle, so we don't leak the thread object. |
68 CloseHandle(reinterpret_cast<HANDLE>(thread)); | 68 CloseHandle(reinterpret_cast<HANDLE>(thread)); |
69 | 69 |
70 return 0; | 70 return 0; |
71 } | 71 } |
72 | 72 |
73 ThreadLocalKey Thread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES; | 73 const ThreadLocalKey Thread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES; |
74 ThreadId Thread::kInvalidThreadId = 0; | 74 const ThreadId Thread::kInvalidThreadId = 0; |
75 | 75 |
76 ThreadLocalKey Thread::CreateThreadLocal() { | 76 ThreadLocalKey Thread::CreateThreadLocal() { |
77 ThreadLocalKey key = TlsAlloc(); | 77 ThreadLocalKey key = TlsAlloc(); |
78 if (key == kUnsetThreadLocalKey) { | 78 if (key == kUnsetThreadLocalKey) { |
79 FATAL1("TlsAlloc failed %d", GetLastError()); | 79 FATAL1("TlsAlloc failed %d", GetLastError()); |
80 } | 80 } |
81 return key; | 81 return key; |
82 } | 82 } |
83 | 83 |
84 | 84 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // signal. This will be treated as a spurious wake-up and is OK | 448 // signal. This will be treated as a spurious wake-up and is OK |
449 // since all uses of monitors should recheck the condition after a | 449 // since all uses of monitors should recheck the condition after a |
450 // Wait. | 450 // Wait. |
451 data_.SignalAndRemoveAllWaiters(); | 451 data_.SignalAndRemoveAllWaiters(); |
452 } | 452 } |
453 | 453 |
454 } // namespace bin | 454 } // namespace bin |
455 } // namespace dart | 455 } // namespace dart |
456 | 456 |
457 #endif // defined(TARGET_OS_WINDOWS) | 457 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |