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

Unified Diff: runtime/bin/thread_win.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: 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
Index: runtime/bin/thread_win.cc
diff --git a/runtime/bin/thread_win.cc b/runtime/bin/thread_win.cc
index db4119604000d64ae30868b7fb32514ae9e30212..b8b73dc442c8244310146e7fa4fab0a7646d07a5 100644
--- a/runtime/bin/thread_win.cc
+++ b/runtime/bin/thread_win.cc
@@ -104,23 +104,7 @@ ThreadId Thread::GetCurrentThreadId() {
bool Thread::Join(ThreadId id) {
- HANDLE handle = OpenThread(SYNCHRONIZE, false, id);
-
- // TODO(zra): OSThread::Start() closes the handle to the thread. Thus, by the
- // time we try to join the thread, its resources may have already been
- // reclaimed, and joining will fail. This can be avoided in a couple of ways.
- // First, GetCurrentThreadJoinId could call OpenThread and return a handle.
- // This is bad, because each of those handles would have to be closed.
- // Second OSThread could be refactored to no longer be AllStatic. Then the
- // handle could be cached in the object by the Start method.
- if (handle == NULL) {
- return false;
- }
-
- DWORD res = WaitForSingleObject(handle, INFINITE);
- CloseHandle(handle);
- ASSERT(res == WAIT_OBJECT_0);
- return true;
+ return false;
}
siva 2016/05/16 17:59:27 The Thread::Join function doesn't seem to be used
zra 2016/05/16 20:32:54 Done.
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | runtime/vm/os_thread.h » ('j') | runtime/vm/os_thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698