| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b41b5ba commit 42db849
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -773,8 +773,13 @@ void DefaultProcessExitHandlerInternal(Environment* env, ExitCode exit_code) { | |||
| 773 | 773 | env->set_can_call_into_js(false); | |
| 774 | 774 | env->stop_sub_worker_contexts(); | |
| 775 | 775 | env->isolate()->DumpAndResetStats(); | |
| 776 | - DisposePlatform(); | ||
| 776 | + // When the process exits, the tasks in the thread pool may also need to | ||
| 777 | + // access the data of V8Platform, such as trace agent, or a field | ||
| 778 | + // added in the future. So make sure the thread pool exits first. | ||
| 779 | + // And make sure V8Platform don not call into Libuv threadpool, see Dispose | ||
| 780 | + // in node_v8_platform-inl.h | ||
| 777 | 781 | uv_library_shutdown(); | |
| 782 | + DisposePlatform(); | ||
| 778 | 783 | Exit(exit_code); | |
| 779 | 784 | } | |
| 780 | 785 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,7 +103,8 @@ struct V8Platform { | |||
| 103 | 103 | platform_ = new NodePlatform(thread_pool_size, controller); | |
| 104 | 104 | v8::V8::InitializePlatform(platform_); | |
| 105 | 105 | } | |
| 106 | - | ||
| 106 | + // Make sure V8Platform don not call into Libuv threadpool, | ||
| 107 | + // see DefaultProcessExitHandlerInternal in environment.cc | ||
| 107 | 108 | inline void Dispose() { | |
| 108 | 109 | if (!initialized_) | |
| 109 | 110 | return; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments