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

Unified Diff: runtime/vm/os_thread_linux.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_android.cc ('k') | runtime/vm/os_thread_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_thread_linux.cc
diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc
index bd9bfaf4fc48155cae95dc0799e7430e84556841..969504270e97e5a773c9bb6fddae4363a139b86c 100644
--- a/runtime/vm/os_thread_linux.cc
+++ b/runtime/vm/os_thread_linux.cc
@@ -194,8 +194,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_android.cc ('k') | runtime/vm/os_thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698