8#include "console_win32.hpp"
9#include "debugger_intf.hpp"
20hi_export_module(hikogui.utility.initialize);
22hi_export
namespace hi {
26enum class initialize_state_type {
32inline thread_local uint16_t initialize_thread_id_dummy;
42 return std::bit_cast<uintptr_t>(
std::addressof(initialize_thread_id_dummy));
58 using namespace std::literals;
61 if (detail::initialize_state.compare_exchange_strong(
expected, detail::initialize_thread_id(), std::memory_order::acquire)) {
76 detail::initialize_state.store(1, std::memory_order::release);
78 }
else if (
expected == detail::initialize_thread_id()) {
79 set_debug_message(
"hi::initialize() re-enterred from same thread.");
85 while (detail::initialize_state.
load(std::memory_order::acquire) != 1) {
Utilities for throwing exceptions and terminating the application.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
hi_inline void initialize() noexcept
Initialize base functionality of HikoGUI.
Definition initialize.hpp:56
hi_inline void start_console() noexcept
Start the console.
Definition console_win32.hpp:21
hi_inline void terminate_handler() noexcept
The HikoGUI terminate handler.
Definition terminate.hpp:66
hi_inline std::terminate_handler old_terminate_handler
The old terminate handler.
Definition terminate.hpp:58
constexpr Out load(In const *src) noexcept
Unaligned Load of a numeric value from an array.
Definition endian.hpp:94
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
hi_inline void enable_debugger() noexcept
Enable the JIT debugger to be attached.
Definition debugger_generic_impl.hpp:17
T set_terminate(T... args)