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

Unified Diff: runtime/vm/os_thread_macos.cc

Issue 1978153002: Uses an open thread handle as the ThreadJoinId on Windows. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix test Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/os_thread_linux.cc ('k') | runtime/vm/os_thread_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread_macos.cc
diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc
index 4c7d094d9f37ac20d011e28778852c22fac00544..b5fd6f9b8e9948feb8150615f08df3d2129fb57a 100644
--- a/runtime/vm/os_thread_macos.cc
+++ b/runtime/vm/os_thread_macos.cc
@@ -168,8 +168,17 @@ ThreadId OSThread::GetCurrentThreadTraceId() {
}
-ThreadJoinId OSThread::GetCurrentThreadJoinId() {
- return pthread_self();
+ThreadJoinId OSThread::GetCurrentThreadJoinId(OSThread* thread) {
+ ASSERT(thread != NULL);
+ // Make sure we're filling in the join id for the current thread.
+ ASSERT(thread->id() == GetCurrentThreadId());
+ // Make sure the join_id_ hasn't been set, yet.
+ DEBUG_ASSERT(thread->join_id_ == kInvalidThreadJoinId);
+ pthread_t id = pthread_self();
+#if defined(DEBUG)
+ thread->join_id_ = id;
+#endif
+ return id;
}
« no previous file with comments | « runtime/vm/os_thread_linux.cc ('k') | runtime/vm/os_thread_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698