diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2770eb..e1123c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,24 +56,6 @@ jobs: os: ubuntu-24.04 install: g++-14 supported: true - - toolset: clang - install: clang-10 - compiler: clang++-10 - cxxstd: "14,17,2a" - os: ubuntu-20.04 - supported: true - - toolset: clang - install: clang-11 - compiler: clang++-11 - cxxstd: "14,17,2a" - os: ubuntu-20.04 - supported: true - - toolset: clang - install: clang-12 - compiler: clang++-12 - cxxstd: "14,17,20" - os: ubuntu-20.04 - supported: true - toolset: clang install: clang-13 compiler: clang++-13 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2168bd0..d8690c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.2 + rev: v20.1.0 hooks: - id: clang-format types_or: [c++, c, cuda] diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a69fd6..65058c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.5...3.16) project(boost_lockfree VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) option(BOOST_LOCKFREE_BUILD_TESTS "Build boost::lockfree tests" OFF) +option(BOOST_LOCKFREE_TESTS_STRESSTEST "Build boost::lockfree with more excessive stress tests" OFF) option(BOOST_LOCKFREE_USE_FILE_SET "Use FILE_SET for boost::lockfree" OFF) if (NOT DEFINED CMAKE_CXX_STANDARD) diff --git a/include/boost/lockfree/detail/atomic.hpp b/include/boost/lockfree/detail/atomic.hpp index cd91454..ebc07d6 100644 --- a/include/boost/lockfree/detail/atomic.hpp +++ b/include/boost/lockfree/detail/atomic.hpp @@ -37,6 +37,6 @@ using detail::memory_order_consume; using detail::memory_order_relaxed; using detail::memory_order_release; -}} // namespace boost::lockfree +}} // namespace boost::lockfree #endif /* BOOST_LOCKFREE_DETAIL_ATOMIC_HPP */ diff --git a/include/boost/lockfree/detail/parameter.hpp b/include/boost/lockfree/detail/parameter.hpp index e25539b..12c42a7 100644 --- a/include/boost/lockfree/detail/parameter.hpp +++ b/include/boost/lockfree/detail/parameter.hpp @@ -84,6 +84,6 @@ using extract_allow_multiple_reads //---------------------------------------------------------------------------------------------------------------------- -}}} // namespace boost::lockfree::detail +}}} // namespace boost::lockfree::detail #endif /* BOOST_LOCKFREE_DETAIL_PARAMETER_HPP */ diff --git a/include/boost/lockfree/detail/tagged_ptr_dcas.hpp b/include/boost/lockfree/detail/tagged_ptr_dcas.hpp index 31d0777..effebf8 100644 --- a/include/boost/lockfree/detail/tagged_ptr_dcas.hpp +++ b/include/boost/lockfree/detail/tagged_ptr_dcas.hpp @@ -114,6 +114,6 @@ class alignas( 2 * sizeof( void* ) ) tagged_ptr tag_t tag; }; -}}} // namespace boost::lockfree::detail +}}} // namespace boost::lockfree::detail #endif /* BOOST_LOCKFREE_TAGGED_PTR_DCAS_HPP_INCLUDED */ diff --git a/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp b/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp index 6df04d8..f9e9d44 100644 --- a/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp +++ b/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp @@ -150,6 +150,6 @@ class tagged_ptr # error unsupported platform #endif -}}} // namespace boost::lockfree::detail +}}} // namespace boost::lockfree::detail #endif /* BOOST_LOCKFREE_TAGGED_PTR_PTRCOMPRESSION_HPP_INCLUDED */ diff --git a/include/boost/lockfree/lockfree_forward.hpp b/include/boost/lockfree/lockfree_forward.hpp index 00e3db2..d51cc87 100644 --- a/include/boost/lockfree/lockfree_forward.hpp +++ b/include/boost/lockfree/lockfree_forward.hpp @@ -59,7 +59,7 @@ class spsc_queue; template < typename T, typename... Options > struct spsc_value; -}} // namespace boost::lockfree +}} // namespace boost::lockfree #endif // BOOST_DOXYGEN_INVOKED #endif // BOOST_LOCKFREE_FORWARD_HPP_INCLUDED diff --git a/include/boost/lockfree/policies.hpp b/include/boost/lockfree/policies.hpp index 5dc3d6c..037efb5 100644 --- a/include/boost/lockfree/policies.hpp +++ b/include/boost/lockfree/policies.hpp @@ -79,6 +79,6 @@ struct allow_multiple_reads; #endif -}} // namespace boost::lockfree +}} // namespace boost::lockfree #endif /* BOOST_LOCKFREE_POLICIES_HPP_INCLUDED */ diff --git a/include/boost/lockfree/spsc_queue.hpp b/include/boost/lockfree/spsc_queue.hpp index 5423294..e7ab3d3 100644 --- a/include/boost/lockfree/spsc_queue.hpp +++ b/include/boost/lockfree/spsc_queue.hpp @@ -142,7 +142,7 @@ class ringbuffer_base return begin; size_t input_count = std::distance( begin, end ); - input_count = ( std::min )( input_count, avail ); + input_count = (std::min)( input_count, avail ); size_t new_write_index = write_index + input_count; @@ -229,7 +229,7 @@ class ringbuffer_base if ( avail == 0 ) return 0; - output_count = ( std::min )( output_count, avail ); + output_count = (std::min)( output_count, avail ); size_t new_read_index = read_index + output_count; diff --git a/include/boost/lockfree/stack.hpp b/include/boost/lockfree/stack.hpp index 1d7e21e..5b353d5 100644 --- a/include/boost/lockfree/stack.hpp +++ b/include/boost/lockfree/stack.hpp @@ -810,6 +810,6 @@ class stack #endif }; -}} // namespace boost::lockfree +}} // namespace boost::lockfree #endif /* BOOST_LOCKFREE_STACK_HPP_INCLUDED */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a651155..51dda6a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -61,8 +61,11 @@ foreach(Test ${Tests}) ) set_target_properties( boost_lockfree-${Test} PROPERTIES CXX_STANDARD_REQUIRED 14) + if (BOOST_LOCKFREE_TESTS_STRESSTEST) + target_compile_definitions(boost_lockfree-${Test} PRIVATE BOOST_LOCKFREE_STRESS_TEST) + endif() + if (TARGET boost_lockfree-${Test}) add_dependencies(boost_lockfree_all_tests boost_lockfree-${Test} ) endif() - endforeach() diff --git a/test/test_common.hpp b/test/test_common.hpp index 24491a9..40577f8 100644 --- a/test/test_common.hpp +++ b/test/test_common.hpp @@ -25,7 +25,7 @@ struct queue_stress_tester #ifndef BOOST_LOCKFREE_STRESS_TEST static const long node_count = 5000; #else - static const long node_count = 500000; + static const long node_count = 5000000; #endif const int reader_threads; const int writer_threads;