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

Side by Side Diff: runtime/bin/thread_macos.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_linux.cc ('k') | runtime/bin/thread_win.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_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "bin/thread.h" 8 #include "bin/thread.h"
9 9
10 #include <sys/errno.h> // NOLINT 10 #include <sys/errno.h> // NOLINT
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 result = pthread_create(&tid, &attr, ThreadStart, data); 100 result = pthread_create(&tid, &attr, ThreadStart, data);
101 RETURN_ON_PTHREAD_FAILURE(result); 101 RETURN_ON_PTHREAD_FAILURE(result);
102 102
103 result = pthread_attr_destroy(&attr); 103 result = pthread_attr_destroy(&attr);
104 RETURN_ON_PTHREAD_FAILURE(result); 104 RETURN_ON_PTHREAD_FAILURE(result);
105 105
106 return 0; 106 return 0;
107 } 107 }
108 108
109 109
110 ThreadLocalKey Thread::kUnsetThreadLocalKey = static_cast<pthread_key_t>(-1); 110 const ThreadLocalKey Thread::kUnsetThreadLocalKey =
111 ThreadId Thread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL); 111 static_cast<pthread_key_t>(-1);
112 const ThreadId Thread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL);
112 113
113 ThreadLocalKey Thread::CreateThreadLocal() { 114 ThreadLocalKey Thread::CreateThreadLocal() {
114 pthread_key_t key = kUnsetThreadLocalKey; 115 pthread_key_t key = kUnsetThreadLocalKey;
115 int result = pthread_key_create(&key, NULL); 116 int result = pthread_key_create(&key, NULL);
116 VALIDATE_PTHREAD_RESULT(result); 117 VALIDATE_PTHREAD_RESULT(result);
117 ASSERT(key != kUnsetThreadLocalKey); 118 ASSERT(key != kUnsetThreadLocalKey);
118 return key; 119 return key;
119 } 120 }
120 121
121 122
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 void Monitor::NotifyAll() { 335 void Monitor::NotifyAll() {
335 // TODO(iposva): Do we need to track lock owners? 336 // TODO(iposva): Do we need to track lock owners?
336 int result = pthread_cond_broadcast(data_.cond()); 337 int result = pthread_cond_broadcast(data_.cond());
337 VALIDATE_PTHREAD_RESULT(result); 338 VALIDATE_PTHREAD_RESULT(result);
338 } 339 }
339 340
340 } // namespace bin 341 } // namespace bin
341 } // namespace dart 342 } // namespace dart
342 343
343 #endif // defined(TARGET_OS_MACOS) 344 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/thread_linux.cc ('k') | runtime/bin/thread_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698