Initialize and run the global context and spawn a user task in a new thread.
This function never returns.
Once the user task finishes, the program exits with status code 0.
Any background threads spawned by
show-image will be joined before the process exits.
It is the responsibility of the user code to join any manually spawned tasks.
macros feature is enabled, you can also wrap your main function with the
instead of manually calling this function.
It is also possible to run a user task in the same thread as the context.
run_context_with_local_task() for more details.
This function panics if initialization of the global context fails.
try_run_context for a variant that allows the user task to handle these initialization errors.
This function also panics if it is called from any thread other than the main thread. Some platforms like OS X require all GUI code to run in the main thread. To ensure portability, this restriction is also enforced on other platforms.