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

Side by Side Diff: runtime/vm/os_thread_win.cc

Issue 1368793002: Add OSThread::GetCurrentThreadTraceId and use it in the timeline implementation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months 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_macos.cc ('k') | runtime/vm/timeline.cc » ('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_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
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
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)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_macos.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698