From 084b49e4f766ed2a1a930dac10efcd8dba0fb677 Mon Sep 17 00:00:00 2001 From: Steffen Winter Date: Fri, 16 Jan 2026 15:30:50 +0100 Subject: [PATCH] refactor: get rid of extern runner thread id --- src/btop.cpp | 7 +++++-- src/btop_shared.hpp | 4 +--- src/btop_tools.hpp | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/btop.cpp b/src/btop.cpp index 7eeb105..c068136 100755 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -124,6 +124,10 @@ namespace Global { atomic reload_conf (false); } +namespace Runner { + static pthread_t runner_id; +} // namespace Runner + //* Handler for SIGWINCH and general resizing events, does nothing if terminal hasn't been resized unless force=true void term_resize(bool force) { static atomic resizing (false); @@ -355,7 +359,7 @@ namespace Runner { atomic waiting (false); atomic redraw (false); atomic coreNum_reset (false); - + static inline auto set_active(bool value) noexcept { active.store(value, std::memory_order_relaxed); active.notify_all(); @@ -408,7 +412,6 @@ namespace Runner { string empty_bg; bool pause_output{}; sigset_t mask; - pthread_t runner_id; pthread_mutex_t mtx; enum debug_actions { diff --git a/src/btop_shared.hpp b/src/btop_shared.hpp index e18f4b2..b3b1d01 100644 --- a/src/btop_shared.hpp +++ b/src/btop_shared.hpp @@ -76,13 +76,11 @@ namespace Runner { extern atomic stopping; extern atomic redraw; extern atomic coreNum_reset; - extern pthread_t runner_id; extern bool pause_output; extern string debug_bg; - void run(const string& box="", bool no_update = false, bool force_redraw = false); + void run(const string& box = "", bool no_update = false, bool force_redraw = false); void stop(); - } namespace Tools { diff --git a/src/btop_tools.hpp b/src/btop_tools.hpp index d066490..92f452f 100644 --- a/src/btop_tools.hpp +++ b/src/btop_tools.hpp @@ -29,7 +29,6 @@ tab-size = 4 #include #include #include -#include #include #include #include