Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: runtime/bin/thread_win.cc

Issue 1482243006: VM: Small clean up and const-ness fix for Thread/OSThread constants. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/thread_macos.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « runtime/bin/thread_macos.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698