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

Unified Diff: runtime/vm/thread.cc

Issue 1410293006: Use ExitProcess on Windows. (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
« runtime/bin/thread_win.cc ('K') | « runtime/bin/thread_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 5c635b9be57e6009e06a129f78d01e162070cffa..5e5266629120ad4b38ed3567f30dc74548f4e8f8 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -125,6 +125,19 @@ static void DeleteThread(void* thread) {
void Thread::Shutdown() {
if (thread_list_lock_ != NULL) {
+ Thread* thread = Current();
+ ASSERT(thread != NULL);
+ delete thread;
+ thread = NULL;
+ SetCurrent(NULL);
+ OSThread::DeleteThreadLocal(thread_key_);
Cutch 2015/10/28 20:33:15 Can we move this TLS cleanup below the ASSERT. O
zra 2015/10/28 21:40:04 Moved.
+ thread_key_ = OSThread::kUnsetThreadLocalKey;
+
+ // Check that there are no more threads, then delete the lock.
+ {
+ MutexLocker ml(thread_list_lock_);
+ ASSERT(thread_list_head_ == NULL);
+ }
delete thread_list_lock_;
thread_list_lock_ = NULL;
}
« runtime/bin/thread_win.cc ('K') | « runtime/bin/thread_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698