diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 46f53acbe..1f7cb8854 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -23,7 +23,7 @@ message("# Building core tests: " ${BUILD_CORE_TESTS}) # Set core source files set(CUBOS_CORE_SOURCE "src/log.cpp" - "src/thread_pool.cpp" + "src/thread/pool.cpp" "src/memory/stream.cpp" "src/memory/standard_stream.cpp" diff --git a/core/include/cubos/core/thread/module.dox b/core/include/cubos/core/thread/module.dox new file mode 100644 index 000000000..5ab782346 --- /dev/null +++ b/core/include/cubos/core/thread/module.dox @@ -0,0 +1,13 @@ +/// @dir +/// @brief @ref core-thread module. + +/// @namespace cubos::core::thread +/// @brief @ref core-thread module. +/// @ingroup core-thread + +namespace cubos::core::thread +{ + /// @defgroup core-thread Threading + /// @ingroup core + /// @brief Provides threading and asynchronous related utilities. +} // namespace cubos::core::thread diff --git a/core/include/cubos/core/thread_pool.hpp b/core/include/cubos/core/thread/pool.hpp similarity index 90% rename from core/include/cubos/core/thread_pool.hpp rename to core/include/cubos/core/thread/pool.hpp index 368474a49..74c041964 100644 --- a/core/include/cubos/core/thread_pool.hpp +++ b/core/include/cubos/core/thread/pool.hpp @@ -1,6 +1,6 @@ /// @file -/// @brief Class @ref cubos::core::ThreadPool. -/// @ingroup core +/// @brief Class @ref cubos::core::thread::ThreadPool. +/// @ingroup core-thread #pragma once @@ -11,11 +11,11 @@ #include #include -namespace cubos::core +namespace cubos::core::thread { /// @brief Manages a pool of threads, to which tasks can be submitted. /// @note Blocks on tasks to finish on destruction. - /// @ingroup core + /// @ingroup core-thread class ThreadPool final { public: @@ -49,4 +49,4 @@ namespace cubos::core std::atomic mNumTasks; ///< Number of tasks currently being executed. bool mStop; ///< Set to true when the thread pool is being destroyed. }; -} // namespace cubos::core +} // namespace cubos::core::thread diff --git a/core/src/thread_pool.cpp b/core/src/thread/pool.cpp similarity index 95% rename from core/src/thread_pool.cpp rename to core/src/thread/pool.cpp index 1632ae414..e010a6211 100644 --- a/core/src/thread_pool.cpp +++ b/core/src/thread/pool.cpp @@ -1,6 +1,6 @@ -#include +#include -using namespace cubos::core; +using cubos::core::thread::ThreadPool; ThreadPool::ThreadPool(std::size_t numThreads) {