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/thread.h" | 5 #include "platform/thread.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/time.h> | 8 #include <sys/time.h> |
9 | 9 |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 | 124 |
125 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { | 125 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { |
126 ASSERT(key != kUnsetThreadLocalKey); | 126 ASSERT(key != kUnsetThreadLocalKey); |
127 int result = pthread_setspecific(key, reinterpret_cast<void*>(value)); | 127 int result = pthread_setspecific(key, reinterpret_cast<void*>(value)); |
128 VALIDATE_PTHREAD_RESULT(result); | 128 VALIDATE_PTHREAD_RESULT(result); |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 intptr_t Thread::GetMaxStackSize() { | 132 intptr_t Thread::GetMaxStackSize() { |
133 const int kStackSize = (1024 * KB); | 133 const int kStackSize = (512 * KB); |
134 return kStackSize; | 134 return kStackSize; |
135 } | 135 } |
136 | 136 |
137 | 137 |
138 Mutex::Mutex() { | 138 Mutex::Mutex() { |
139 pthread_mutexattr_t attr; | 139 pthread_mutexattr_t attr; |
140 int result = pthread_mutexattr_init(&attr); | 140 int result = pthread_mutexattr_init(&attr); |
141 VALIDATE_PTHREAD_RESULT(result); | 141 VALIDATE_PTHREAD_RESULT(result); |
142 | 142 |
143 #if defined(DEBUG) | 143 #if defined(DEBUG) |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 | 274 |
275 void Monitor::NotifyAll() { | 275 void Monitor::NotifyAll() { |
276 // TODO(iposva): Do we need to track lock owners? | 276 // TODO(iposva): Do we need to track lock owners? |
277 int result = pthread_cond_broadcast(data_.cond()); | 277 int result = pthread_cond_broadcast(data_.cond()); |
278 VALIDATE_PTHREAD_RESULT(result); | 278 VALIDATE_PTHREAD_RESULT(result); |
279 } | 279 } |
280 | 280 |
281 } // namespace dart | 281 } // namespace dart |
OLD | NEW |