| 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/globals.h" // NOLINT | 5 #include "platform/globals.h" // NOLINT |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/os_thread.h" | 8 #include "vm/os_thread.h" |
| 9 | 9 |
| 10 #include <process.h> // NOLINT | 10 #include <process.h> // NOLINT |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const int kStackSize = (128 * kWordSize * KB); | 95 const int kStackSize = (128 * kWordSize * KB); |
| 96 return kStackSize; | 96 return kStackSize; |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 ThreadId OSThread::GetCurrentThreadId() { | 100 ThreadId OSThread::GetCurrentThreadId() { |
| 101 return ::GetCurrentThreadId(); | 101 return ::GetCurrentThreadId(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 ThreadId OSThread::GetCurrentThreadTraceId() { |
| 106 return ::GetCurrentThreadId(); |
| 107 } |
| 108 |
| 109 |
| 105 ThreadJoinId OSThread::GetCurrentThreadJoinId() { | 110 ThreadJoinId OSThread::GetCurrentThreadJoinId() { |
| 106 return ::GetCurrentThreadId(); | 111 return ::GetCurrentThreadId(); |
| 107 } | 112 } |
| 108 | 113 |
| 109 | 114 |
| 110 void OSThread::Join(ThreadJoinId id) { | 115 void OSThread::Join(ThreadJoinId id) { |
| 111 HANDLE handle = OpenThread(SYNCHRONIZE, false, id); | 116 HANDLE handle = OpenThread(SYNCHRONIZE, false, id); |
| 112 | 117 |
| 113 // TODO(zra): OSThread::Start() closes the handle to the thread. Thus, by the | 118 // TODO(zra): OSThread::Start() closes the handle to the thread. Thus, by the |
| 114 // time we try to join the thread, its resources may have already been | 119 // time we try to join the thread, its resources may have already been |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // timeout before we signal it, that object will get an extra | 476 // timeout before we signal it, that object will get an extra |
| 472 // signal. This will be treated as a spurious wake-up and is OK | 477 // signal. This will be treated as a spurious wake-up and is OK |
| 473 // since all uses of monitors should recheck the condition after a | 478 // since all uses of monitors should recheck the condition after a |
| 474 // Wait. | 479 // Wait. |
| 475 data_.SignalAndRemoveAllWaiters(); | 480 data_.SignalAndRemoveAllWaiters(); |
| 476 } | 481 } |
| 477 | 482 |
| 478 } // namespace dart | 483 } // namespace dart |
| 479 | 484 |
| 480 #endif // defined(TARGET_OS_WINDOWS) | 485 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |