From 073c40b79dd10e973b0807f1b162e3bcdd5900ac Mon Sep 17 00:00:00 2001 From: Christian Kern Date: Tue, 7 Oct 2014 12:17:16 +0200 Subject: [PATCH] Remove warnings (gcc): - shift initialization of is_active to correct position - remove unused variable --- containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h | 7 ++----- containers_cpp/test/main.cc | 34 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 21 deletions(-) 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 a8b4e50..6d72bf2 100644 --- a/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h +++ b/containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h @@ -150,14 +150,14 @@ HazardPointerThreadEntry(GuardType undefined_guard, int guards_per_thread, undefined_guard(undefined_guard), guards_per_thread(guards_per_thread), max_size_retired_list(max_size_retired_list), - retired_list(max_size_retired_list), - retired_list_temp(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 // progress. // Still, threads can be leave the hazard pointer processing (deactivation), // but this can only be done once, i.e., this is not revertable... is_active(1), + retired_list(max_size_retired_list), + retired_list_temp(max_size_retired_list), hazard_pointer_list_temp(embb::base::Thread::GetThreadsMaxCount() * guards_per_thread) { // Initialize guarded pointer list @@ -240,9 +240,6 @@ HazardPointer< GuardType >::GetHazardPointerElementForCurrentThread() { // stop operating, and the others are responsible for his retired // list. - HazardPointerThreadEntry_t* current_thread_entry = - &hazard_pointer_thread_entry_array[GetCurrentThreadIndex()]; - return hazard_pointer_thread_entry_array[GetCurrentThreadIndex()]; } diff --git a/containers_cpp/test/main.cc b/containers_cpp/test/main.cc index bb4f8ce..60ee56f 100644 --- a/containers_cpp/test/main.cc +++ b/containers_cpp/test/main.cc @@ -45,26 +45,28 @@ PT_MAIN("Data Structures C++") { unsigned int max_threads = static_cast(2 * partest::TestSuite::GetDefaultNumThreads()); embb_thread_set_max_count(max_threads); + for (;;) + { + PT_RUN(embb::containers::test::PoolTest < + embb::containers::WaitFreeArrayValuePool > ); + PT_RUN(embb::containers::test::PoolTest < + embb::containers::LockFreeTreeValuePool > ); - PT_RUN(embb::containers::test::PoolTest< - embb::containers::WaitFreeArrayValuePool >); - PT_RUN(embb::containers::test::PoolTest< - embb::containers::LockFreeTreeValuePool >); + PT_RUN(embb::containers::test::HazardPointerTest); - PT_RUN(embb::containers::test::HazardPointerTest); + PT_RUN(embb::containers::test::QueueTest< + embb::containers::WaitFreeSPSCQueue >); - PT_RUN(embb::containers::test::QueueTest< - embb::containers::WaitFreeSPSCQueue >); + PT_RUN(embb::containers::test::QueueTest < + embb::containers::LockFreeMPMCQueue COMMA true COMMA true > ); - PT_RUN(embb::containers::test::QueueTest< - embb::containers::LockFreeMPMCQueue COMMA true COMMA true >); + PT_RUN(embb::containers::test::StackTest< + embb::containers::LockFreeStack >); - PT_RUN(embb::containers::test::StackTest< - embb::containers::LockFreeStack >); + PT_RUN(embb::containers::test::ObjectPoolTest + >); - PT_RUN(embb::containers::test::ObjectPoolTest - >); - - PT_RUN(embb::containers::test::ObjectPoolTest - >); + PT_RUN(embb::containers::test::ObjectPoolTest + >); + } } -- libgit2 0.26.0