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

Side by Side Diff: runtime/vm/os_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/vm/os_thread_win.h ('k') | no next file » | 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" // NOLINT 5 #include "platform/globals.h" // NOLINT
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/os_thread.h" 9 #include "vm/os_thread.h"
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #endif 79 #endif
80 return errno; 80 return errno;
81 } 81 }
82 82
83 // Close the handle, so we don't leak the thread object. 83 // Close the handle, so we don't leak the thread object.
84 CloseHandle(reinterpret_cast<HANDLE>(thread)); 84 CloseHandle(reinterpret_cast<HANDLE>(thread));
85 85
86 return 0; 86 return 0;
87 } 87 }
88 88
89 ThreadLocalKey OSThread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES; 89
90 ThreadId OSThread::kInvalidThreadId = 0; 90 const ThreadId OSThread::kInvalidThreadId = 0;
91 ThreadJoinId OSThread::kInvalidThreadJoinId = 0; 91 const ThreadJoinId OSThread::kInvalidThreadJoinId = 0;
92
92 93
93 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) { 94 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
94 ThreadLocalKey key = TlsAlloc(); 95 ThreadLocalKey key = TlsAlloc();
95 if (key == kUnsetThreadLocalKey) { 96 if (key == kUnsetThreadLocalKey) {
96 FATAL1("TlsAlloc failed %d", GetLastError()); 97 FATAL1("TlsAlloc failed %d", GetLastError());
97 } 98 }
98 ThreadLocalData::AddThreadLocal(key, destructor); 99 ThreadLocalData::AddThreadLocal(key, destructor);
99 return key; 100 return key;
100 } 101 }
101 102
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 #pragma data_seg(".CRT$XLB") 699 #pragma data_seg(".CRT$XLB")
699 PIMAGE_TLS_CALLBACK p_thread_callback_dart = OnDartThreadExit; 700 PIMAGE_TLS_CALLBACK p_thread_callback_dart = OnDartThreadExit;
700 701
701 // Reset the default section. 702 // Reset the default section.
702 #pragma data_seg() 703 #pragma data_seg()
703 704
704 #endif // _WIN64 705 #endif // _WIN64
705 } // extern "C" 706 } // extern "C"
706 707
707 #endif // defined(TARGET_OS_WINDOWS) 708 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698