From 8ac314c806a0ed0d78a000474a779743d6ae5943 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 28 Oct 2024 18:01:24 +0100 Subject: Renamed tracker.h → tracker.hpp, nameof.h → nameof.hpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/intercopycontext.cpp | 2 +- src/lanes.cpp | 2 +- src/nameof.cpp | 2 +- src/nameof.h | 5 ----- src/nameof.hpp | 5 +++++ src/tracker.cpp | 2 +- src/tracker.h | 26 -------------------------- src/tracker.hpp | 26 ++++++++++++++++++++++++++ src/universe.h | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 src/nameof.h create mode 100644 src/nameof.hpp delete mode 100644 src/tracker.h create mode 100644 src/tracker.hpp (limited to 'src') diff --git a/src/intercopycontext.cpp b/src/intercopycontext.cpp index a5e2a64..3f2e840 100644 --- a/src/intercopycontext.cpp +++ b/src/intercopycontext.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include "keeper.hpp" #include "lane.h" #include "linda.h" -#include "nameof.h" +#include "nameof.hpp" #include "universe.h" // ################################################################################################# diff --git a/src/lanes.cpp b/src/lanes.cpp index 5fcb9a4..23ab400 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp @@ -86,7 +86,7 @@ THE SOFTWARE. #include "intercopycontext.h" #include "keeper.hpp" #include "lane.h" -#include "nameof.h" +#include "nameof.hpp" #include "state.h" #include "threading.h" #include "tools.hpp" diff --git a/src/nameof.cpp b/src/nameof.cpp index 496f9d9..1bf55d1 100644 --- a/src/nameof.cpp +++ b/src/nameof.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. */ #include "_pch.hpp" -#include "nameof.h" +#include "nameof.hpp" #include "tools.hpp" diff --git a/src/nameof.h b/src/nameof.h deleted file mode 100644 index 6709a16..0000000 --- a/src/nameof.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include "macros_and_utils.hpp" - -LUAG_FUNC(nameof); diff --git a/src/nameof.hpp b/src/nameof.hpp new file mode 100644 index 0000000..6709a16 --- /dev/null +++ b/src/nameof.hpp @@ -0,0 +1,5 @@ +#pragma once + +#include "macros_and_utils.hpp" + +LUAG_FUNC(nameof); diff --git a/src/tracker.cpp b/src/tracker.cpp index 83c2261..3697925 100644 --- a/src/tracker.cpp +++ b/src/tracker.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. =============================================================================== */ #include "_pch.hpp" -#include "tracker.h" +#include "tracker.hpp" #include "lane.h" diff --git a/src/tracker.h b/src/tracker.h deleted file mode 100644 index dcf3c6e..0000000 --- a/src/tracker.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -class Lane; -struct lua_State; - -// The chain is ended by '(Lane*)(-1)', not nullptr: -// 'trackingFirst -> ... -> ... -> (-1)' -#define TRACKING_END ((Lane*) (-1)) - -class LaneTracker -{ - private: - mutable std::mutex trackingMutex; - Lane* volatile trackingFirst{ nullptr }; // will change to TRACKING_END if we want to activate tracking - - public: - void tracking_add(Lane* lane_); - [[nodiscard]] bool tracking_remove(Lane* lane_); - [[nodiscard]] int pushThreadsTable(lua_State* L_) const; - void activate() { - trackingFirst = TRACKING_END; - } - [[nodiscard]] bool isActive() const { - return trackingFirst != nullptr; - } -}; diff --git a/src/tracker.hpp b/src/tracker.hpp new file mode 100644 index 0000000..dcf3c6e --- /dev/null +++ b/src/tracker.hpp @@ -0,0 +1,26 @@ +#pragma once + +class Lane; +struct lua_State; + +// The chain is ended by '(Lane*)(-1)', not nullptr: +// 'trackingFirst -> ... -> ... -> (-1)' +#define TRACKING_END ((Lane*) (-1)) + +class LaneTracker +{ + private: + mutable std::mutex trackingMutex; + Lane* volatile trackingFirst{ nullptr }; // will change to TRACKING_END if we want to activate tracking + + public: + void tracking_add(Lane* lane_); + [[nodiscard]] bool tracking_remove(Lane* lane_); + [[nodiscard]] int pushThreadsTable(lua_State* L_) const; + void activate() { + trackingFirst = TRACKING_END; + } + [[nodiscard]] bool isActive() const { + return trackingFirst != nullptr; + } +}; diff --git a/src/universe.h b/src/universe.h index 3959817..18e125f 100644 --- a/src/universe.h +++ b/src/universe.h @@ -3,7 +3,7 @@ #include "allocator.hpp" #include "keeper.hpp" #include "lanesconf.h" -#include "tracker.h" +#include "tracker.hpp" #include "uniquekey.hpp" // ################################################################################################# -- cgit v1.2.3-55-g6feb