#pragma once #include #include #include namespace vcpkg { struct GlobalState { static Util::LockGuarded timer; static Util::LockGuarded g_surveydate; static std::atomic debugging; static std::atomic feature_packages; static std::atomic g_binary_caching; static std::atomic g_init_console_cp; static std::atomic g_init_console_output_cp; static std::atomic g_init_console_initialized; struct CtrlCStateMachine { CtrlCStateMachine(); void transition_to_spawn_process() noexcept; void transition_from_spawn_process() noexcept; void transition_handle_ctrl_c() noexcept; private: enum class CtrlCState { normal, blocked_on_child, exit_requested, }; std::atomic m_state; }; static CtrlCStateMachine g_ctrl_c_state; }; }