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

Unified Diff: runtime/bin/eventhandler_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: 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 | « no previous file | runtime/bin/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index dfd4985a8e3bfc160716b917a6cd709f70c066c7..9c952042a7cae12361305a02c5e9ac6666a2d3b1 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -188,21 +188,13 @@ void Handle::WaitForReadThreadStarted() {
void Handle::WaitForReadThreadFinished() {
- // Join the Reader thread if there is one.
- ThreadId to_join = Thread::kInvalidThreadId;
- {
- MonitorLocker ml(monitor_);
- if (read_thread_id_ != Thread::kInvalidThreadId) {
- while (!read_thread_finished_) {
- ml.Wait();
- }
- read_thread_finished_ = false;
- to_join = read_thread_id_;
- read_thread_id_ = Thread::kInvalidThreadId;
+ MonitorLocker ml(monitor_);
+ if (read_thread_id_ != Thread::kInvalidThreadId) {
+ while (!read_thread_finished_) {
+ ml.Wait();
}
- }
- if (to_join != Thread::kInvalidThreadId) {
- Thread::Join(to_join);
+ read_thread_finished_ = false;
+ read_thread_id_ = Thread::kInvalidThreadId;
}
}
@@ -839,7 +831,6 @@ void StdHandle::DoClose() {
while (write_thread_exists_) {
ml.Wait(Monitor::kNoTimeout);
}
- Thread::Join(thread_id_);
}
Handle::DoClose();
}
@@ -1376,7 +1367,6 @@ EventHandlerImplementation::EventHandlerImplementation() {
EventHandlerImplementation::~EventHandlerImplementation() {
- Thread::Join(handler_thread_id_);
delete startup_monitor_;
CloseHandle(completion_port_);
}
« no previous file with comments | « no previous file | runtime/bin/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698