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

Unified Diff: runtime/vm/thread_pool.cc

Issue 1557033002: Fixes for OSThread creation shutdown race. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 12 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.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_pool.cc
diff --git a/runtime/vm/thread_pool.cc b/runtime/vm/thread_pool.cc
index 02f406a0490750fbce0e53c2c10dfe57830dcc64..19c0a4d363a8ca1af052887c31e6c3e072e48860 100644
--- a/runtime/vm/thread_pool.cc
+++ b/runtime/vm/thread_pool.cc
@@ -107,16 +107,10 @@ void ThreadPool::Shutdown() {
while (current != NULL) {
Worker* next = current->all_next_;
ThreadId currentId = current->id();
- ASSERT(id != currentId);
- if (currentId == OSThread::kInvalidThreadId) {
- // If the thread id is invalid, it means the thread never started
- // because OSThread creation was disabled. Destroy the Task and Worker.
- delete current->task_;
- delete current;
- } else {
+ if (currentId != id) {
AddWorkerToShutdownList(current);
- current->Shutdown();
}
+ current->Shutdown();
current = next;
}
saved = NULL;
« no previous file with comments | « runtime/vm/os_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698