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

Side by Side Diff: runtime/vm/os_thread_android.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_android.h ('k') | runtime/vm/os_thread_linux.h » ('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" // NOLINT 5 #include "platform/globals.h" // NOLINT
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include "vm/os_thread.h" 8 #include "vm/os_thread.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 result = pthread_create(&tid, &attr, ThreadStart, data); 122 result = pthread_create(&tid, &attr, ThreadStart, data);
123 RETURN_ON_PTHREAD_FAILURE(result); 123 RETURN_ON_PTHREAD_FAILURE(result);
124 124
125 result = pthread_attr_destroy(&attr); 125 result = pthread_attr_destroy(&attr);
126 RETURN_ON_PTHREAD_FAILURE(result); 126 RETURN_ON_PTHREAD_FAILURE(result);
127 127
128 return 0; 128 return 0;
129 } 129 }
130 130
131 131
132 ThreadLocalKey OSThread::kUnsetThreadLocalKey = 132 const ThreadId OSThread::kInvalidThreadId = static_cast<ThreadId>(0);
133 static_cast<pthread_key_t>(-1); 133 const ThreadJoinId OSThread::kInvalidThreadJoinId =
134 ThreadId OSThread::kInvalidThreadId = static_cast<ThreadId>(0); 134 static_cast<ThreadJoinId>(0);
135 ThreadJoinId OSThread::kInvalidThreadJoinId = static_cast<ThreadJoinId>(0); 135
136 136
137 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) { 137 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
138 pthread_key_t key = kUnsetThreadLocalKey; 138 pthread_key_t key = kUnsetThreadLocalKey;
139 int result = pthread_key_create(&key, destructor); 139 int result = pthread_key_create(&key, destructor);
140 VALIDATE_PTHREAD_RESULT(result); 140 VALIDATE_PTHREAD_RESULT(result);
141 ASSERT(key != kUnsetThreadLocalKey); 141 ASSERT(key != kUnsetThreadLocalKey);
142 return key; 142 return key;
143 } 143 }
144 144
145 145
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 void Monitor::NotifyAll() { 407 void Monitor::NotifyAll() {
408 // When running with assertions enabled we track the owner. 408 // When running with assertions enabled we track the owner.
409 ASSERT(IsOwnedByCurrentThread()); 409 ASSERT(IsOwnedByCurrentThread());
410 int result = pthread_cond_broadcast(data_.cond()); 410 int result = pthread_cond_broadcast(data_.cond());
411 VALIDATE_PTHREAD_RESULT(result); 411 VALIDATE_PTHREAD_RESULT(result);
412 } 412 }
413 413
414 } // namespace dart 414 } // namespace dart
415 415
416 #endif // defined(TARGET_OS_ANDROID) 416 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_android.h ('k') | runtime/vm/os_thread_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698