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

Unified Diff: runtime/vm/thread_pool.cc

Issue 1807293002: - Fix for issue 25950 (add registration of a thread exit callback) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 9 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/random.cc ('k') | runtime/vm/timeline.cc » ('j') | 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 b281d5c47fb6344392ca24a817418a2d6d9f216f..70bac99675bfd66b65c0e53418dea7ae99caf57d 100644
--- a/runtime/vm/thread_pool.cc
+++ b/runtime/vm/thread_pool.cc
@@ -4,6 +4,7 @@
#include "vm/thread_pool.h"
+#include "vm/dart.h"
#include "vm/flags.h"
#include "vm/lockers.h"
@@ -480,6 +481,12 @@ void ThreadPool::Worker::Main(uword args) {
// wait for the thread to exit by joining on it in Shutdown().
delete worker;
}
+
+ // Call the thread exit hook here to notify the embedder that the
+ // thread pool thread is exiting.
+ if (Dart::thread_exit_callback() != NULL) {
+ (*Dart::thread_exit_callback())();
+ }
}
} // namespace dart
« no previous file with comments | « runtime/vm/random.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698