diff --git a/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h b/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h index 05d2a99..c29eb28 100644 --- a/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h +++ b/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h @@ -151,7 +151,7 @@ HazardPointerThreadEntry(GuardType undefined_guard, int guards_per_thread, guards_per_thread(guards_per_thread), max_size_retired_list(max_size_retired_list), // initially, each potential thread is active... if that is not the case - // another thread could call "HelpScan", and block this thread in making + // another thread could call "HelpScan", and block this thread in making // progress. // Still, threads can be leave the hazard pointer processing (deactivation), // but this can only be done once, i.e., this is not revertable... @@ -271,8 +271,7 @@ Scan(HazardPointerThreadEntry_t* currentHazardPointerEntry) { // a bug... this assertions checks that int expected = -1; if (!currentHazardPointerEntry->GetScanningThread().CompareAndSwap( - expected, static_cast(GetCurrentThreadIndex()))) - { + expected, static_cast(GetCurrentThreadIndex()))) { assert(false); } #endif diff --git a/containers_cpp/include/embb/containers/internal/hazard_pointer.h b/containers_cpp/include/embb/containers/internal/hazard_pointer.h index 2fff100..03dc57c 100644 --- a/containers_cpp/include/embb/containers/internal/hazard_pointer.h +++ b/containers_cpp/include/embb/containers/internal/hazard_pointer.h @@ -169,17 +169,18 @@ class FixedSizeList { */ template< typename GuardType > class HazardPointerThreadEntry { - #ifdef EMBB_DEBUG - public: - embb::base::Atomic& GetScanningThread() - { + + public: + embb::base::Atomic& GetScanningThread() { return who_is_scanning; } - private: + + private: embb::base::Atomic who_is_scanning; #endif - private: + + private: /** * Value of the undefined guard (means that no guard is set). */ diff --git a/scripts/run_cpplint.sh b/scripts/run_cpplint.sh index 9717039..21f23bb 100755 --- a/scripts/run_cpplint.sh +++ b/scripts/run_cpplint.sh @@ -110,6 +110,9 @@ do if [[ $file == *atomic_arithmetic.h ]]; then current_rules+=",-readability/function" # All parameters should be named in a function fi + if [[ $file == *object_pool-inl.h ]]; then + current_rules+=",-readability/function" # All parameters should be named in a function (triggers error with clang if named...) + fi for filename in "${RAND_FILES[@]}"; do if [[ $file =~ $filename ]]; then current_rules+=",-runtime/threadsafe_fn" # These tests are allowed to use the thread unsafe rand()