-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change the
system_context
to be replaceable at runtime
also, fix static initialization order fiasco issues wrt the system context at shutdown. this design for the system context has a few nice properties: * lazily constructed at first use * accessible by default-constructing a system_context object, which grabs a ref-count to the current global system context in its ctor and releases it in its dtor. * is usable at all points during the execution of the program, even before/after main, with no Static Initialization Order Fiasco. * is replaceable at runtime as many times as you like. * replacing the global system context does not affect any existing `system_context` objects. * shuts down cleanly with no leaks * this commit changes the ABI of the system context interfaces, so it bumps the version number. * it also reserves space in the `system_context_interface` and `system_scheduler_interface` for additional "virtual" functions. adds two helper types: `system_context_base` and `system_scheduler_base`, which automate the population of the `system_context_interface` and `system_scheduler_interface` "vtables", respectively. it also adds `static_system_context_instance` to make it simple to safely put a custom system context into static storage.
- Loading branch information
1 parent
bfc2610
commit e5945b5
Showing
7 changed files
with
623 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.