| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1b4790b commit 0a35d49
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -712,7 +712,8 @@ ThreadId AllocateEnvironmentThreadId() { | |||
| 712 | 712 | } | |
| 713 | 713 | ||
| 714 | 714 | void DefaultProcessExitHandler(Environment* env, int exit_code) { | |
| 715 | - Stop(env); | ||
| 715 | + env->set_can_call_into_js(false); | ||
| 716 | + env->stop_sub_worker_contexts(); | ||
| 716 | 717 | DisposePlatform(); | |
| 717 | 718 | uv_library_shutdown(); | |
| 718 | 719 | exit(exit_code); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -550,10 +550,9 @@ void Environment::InitializeLibuv(bool start_profiler_idle_notifier) { | |||
| 550 | 550 | } | |
| 551 | 551 | } | |
| 552 | 552 | ||
| 553 | - void Environment::Stop() { | ||
| 553 | + void Environment::ExitEnv() { | ||
| 554 | 554 | set_can_call_into_js(false); | |
| 555 | 555 | set_stopping(true); | |
| 556 | - stop_sub_worker_contexts(); | ||
| 557 | 556 | isolate_->TerminateExecution(); | |
| 558 | 557 | SetImmediateThreadsafe([](Environment* env) { uv_stop(env->event_loop()); }); | |
| 559 | 558 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -926,7 +926,7 @@ class Environment : public MemoryRetainer { | |||
| 926 | 926 | void RegisterHandleCleanups(); | |
| 927 | 927 | void CleanupHandles(); | |
| 928 | 928 | void Exit(int code); | |
| 929 | - void Stop(); | ||
| 929 | + void ExitEnv(); | ||
| 930 | 930 | ||
| 931 | 931 | // Register clean-up cb to be called on environment destruction. | |
| 932 | 932 | inline void RegisterHandleCleanup(uv_handle_t* handle, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1035,7 +1035,7 @@ int Start(int argc, char** argv) { | |||
| 1035 | 1035 | } | |
| 1036 | 1036 | ||
| 1037 | 1037 | int Stop(Environment* env) { | |
| 1038 | - env->Stop(); | ||
| 1038 | + env->ExitEnv(); | ||
| 1039 | 1039 | return 0; | |
| 1040 | 1040 | } | |
| 1041 | 1041 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -218,8 +218,7 @@ class Environment; | |||
| 218 | 218 | NODE_EXTERN int Start(int argc, char* argv[]); | |
| 219 | 219 | ||
| 220 | 220 | // Tear down Node.js while it is running (there are active handles | |
| 221 | - // in the loop and / or actively executing JavaScript code). This also stops | ||
| 222 | - // all Workers that may have been started earlier. | ||
| 221 | + // in the loop and / or actively executing JavaScript code). | ||
| 223 | 222 | NODE_EXTERN int Stop(Environment* env); | |
| 224 | 223 | ||
| 225 | 224 | // TODO(addaleax): Officially deprecate this and replace it with something | |
@@ -469,8 +468,8 @@ NODE_EXTERN void FreeEnvironment(Environment* env); | |||
| 469 | 468 | // It receives the Environment* instance and the exit code as arguments. | |
| 470 | 469 | // This could e.g. call Stop(env); in order to terminate execution and stop | |
| 471 | 470 | // the event loop. | |
| 472 | - // The default handler calls Stop(), disposes of the global V8 platform | ||
| 473 | - // instance, if one is being used, and calls exit(). | ||
| 471 | + // The default handler disposes of the global V8 platform instance, if one is | ||
| 472 | + // being used, and calls exit(). | ||
| 474 | 473 | NODE_EXTERN void SetProcessExitHandler( | |
| 475 | 474 | Environment* env, | |
| 476 | 475 | std::function<void(Environment*, int)>&& handler); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments