@@ -83,17 +83,25 @@ var VERBOSE = false;
8383// [link]
8484var INVOKE_RUN = true ;
8585
86- // If 0, the runtime is not quit when main() completes (allowing code to
87- // run afterwards, for example from the browser main event loop). atexit()s
88- // are also not executed, and we can avoid including code for runtime shutdown,
89- // like flushing the stdio streams.
90- // Set this to 1 if you do want atexit()s or stdio streams to be flushed
91- // on exit.
86+ // If 0, support for shutting down the runtime is not emitted into the build.
87+ // This means that the program is not quit when main() completes, but execution
88+ // will yield to the event loop of the JS environment, allowing event handlers
89+ // to run afterwards. If 0, C++ global destructors will not be emitted into the
90+ // build either, to save on code size. Calling exit() will throw an unwinding
91+ // exception, but will not shut down the runtime.
92+ //
93+ // Set this to 1 if you do want to retain the ability to shut down the program.
94+ // If 1, then completing main() will by default call exit(), unless a refcount
95+ // keeps the runtime alive. Call emscripten_exit_with_live_runtime() to finish
96+ // main() while keeping the runtime alive. Calling emscripten_force_exit() will
97+ // shut down the runtime, invoking atexit()s, and flushing stdio streams.
9298// This setting is controlled automatically in STANDALONE_WASM mode:
9399//
94100// - For a command (has a main function) this is always 1
95- // - For a reactor (no a main function) this is always 0
101+ // - For a reactor (no main function) this is always 0
96102//
103+ // For more details, see documentation for emscripten_force_exit() and
104+ // emscripten_exit_with_live_runtime().
97105// [link]
98106var EXIT_RUNTIME = false ;
99107
0 commit comments