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 <sys/errno.h> | 7 #include <sys/errno.h> |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 | 108 |
109 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { | 109 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { |
110 ASSERT(key != kUnsetThreadLocalKey); | 110 ASSERT(key != kUnsetThreadLocalKey); |
111 int result = pthread_setspecific(key, reinterpret_cast<void*>(value)); | 111 int result = pthread_setspecific(key, reinterpret_cast<void*>(value)); |
112 VALIDATE_PTHREAD_RESULT(result); | 112 VALIDATE_PTHREAD_RESULT(result); |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 intptr_t Thread::GetMaxStackSize() { | 116 intptr_t Thread::GetMaxStackSize() { |
117 const int kStackSize = (1024 * KB); | 117 const int kStackSize = (512 * KB); |
118 return kStackSize; | 118 return kStackSize; |
119 } | 119 } |
120 | 120 |
121 | 121 |
122 Mutex::Mutex() { | 122 Mutex::Mutex() { |
123 pthread_mutexattr_t attr; | 123 pthread_mutexattr_t attr; |
124 int result = pthread_mutexattr_init(&attr); | 124 int result = pthread_mutexattr_init(&attr); |
125 VALIDATE_PTHREAD_RESULT(result); | 125 VALIDATE_PTHREAD_RESULT(result); |
126 | 126 |
127 #if defined(DEBUG) | 127 #if defined(DEBUG) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 | 252 |
253 | 253 |
254 void Monitor::NotifyAll() { | 254 void Monitor::NotifyAll() { |
255 // TODO(iposva): Do we need to track lock owners? | 255 // TODO(iposva): Do we need to track lock owners? |
256 int result = pthread_cond_broadcast(data_.cond()); | 256 int result = pthread_cond_broadcast(data_.cond()); |
257 VALIDATE_PTHREAD_RESULT(result); | 257 VALIDATE_PTHREAD_RESULT(result); |
258 } | 258 } |
259 | 259 |
260 } // namespace dart | 260 } // namespace dart |
OLD | NEW |