| 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 <process.h> | 7 #include <process.h> |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void Thread::DeleteThreadLocal(ThreadLocalKey key) { | 77 void Thread::DeleteThreadLocal(ThreadLocalKey key) { |
| 78 ASSERT(key != kUnsetThreadLocalKey); | 78 ASSERT(key != kUnsetThreadLocalKey); |
| 79 BOOL result = TlsFree(key); | 79 BOOL result = TlsFree(key); |
| 80 if (!result) { | 80 if (!result) { |
| 81 FATAL("TlsFree failed"); | 81 FATAL("TlsFree failed"); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 | 85 |
| 86 intptr_t Thread::GetMaxStackSize() { | 86 intptr_t Thread::GetMaxStackSize() { |
| 87 const int kStackSize = (1024 * KB); | 87 const int kStackSize = (512 * KB); |
| 88 return kStackSize; | 88 return kStackSize; |
| 89 } | 89 } |
| 90 | 90 |
| 91 | 91 |
| 92 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { | 92 void Thread::SetThreadLocal(ThreadLocalKey key, uword value) { |
| 93 ASSERT(key != kUnsetThreadLocalKey); | 93 ASSERT(key != kUnsetThreadLocalKey); |
| 94 BOOL result = TlsSetValue(key, reinterpret_cast<void*>(value)); | 94 BOOL result = TlsSetValue(key, reinterpret_cast<void*>(value)); |
| 95 if (!result) { | 95 if (!result) { |
| 96 FATAL("TlsSetValue failed"); | 96 FATAL("TlsSetValue failed"); |
| 97 } | 97 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 void Monitor::NotifyAll() { | 329 void Monitor::NotifyAll() { |
| 330 // If one of the objects in the list of waiters wakes because of a | 330 // If one of the objects in the list of waiters wakes because of a |
| 331 // timeout before we signal it, that object will get an extra | 331 // timeout before we signal it, that object will get an extra |
| 332 // signal. This will be treated as a spurious wake-up and is OK | 332 // signal. This will be treated as a spurious wake-up and is OK |
| 333 // since all uses of monitors should recheck the condition after a | 333 // since all uses of monitors should recheck the condition after a |
| 334 // Wait. | 334 // Wait. |
| 335 data_.SignalAndRemoveAllWaiters(); | 335 data_.SignalAndRemoveAllWaiters(); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace dart | 338 } // namespace dart |
| OLD | NEW |