Commit 073c40b7 by Christian Kern

Remove warnings (gcc):

- shift initialization of is_active to correct position
- remove unused variable
parent 753e386f
...@@ -150,14 +150,14 @@ HazardPointerThreadEntry(GuardType undefined_guard, int guards_per_thread, ...@@ -150,14 +150,14 @@ HazardPointerThreadEntry(GuardType undefined_guard, int guards_per_thread,
undefined_guard(undefined_guard), undefined_guard(undefined_guard),
guards_per_thread(guards_per_thread), guards_per_thread(guards_per_thread),
max_size_retired_list(max_size_retired_list), 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 // 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. // progress.
// Still, threads can be leave the hazard pointer processing (deactivation), // Still, threads can be leave the hazard pointer processing (deactivation),
// but this can only be done once, i.e., this is not revertable... // but this can only be done once, i.e., this is not revertable...
is_active(1), is_active(1),
retired_list(max_size_retired_list),
retired_list_temp(max_size_retired_list),
hazard_pointer_list_temp(embb::base::Thread::GetThreadsMaxCount() * hazard_pointer_list_temp(embb::base::Thread::GetThreadsMaxCount() *
guards_per_thread) { guards_per_thread) {
// Initialize guarded pointer list // Initialize guarded pointer list
...@@ -240,9 +240,6 @@ HazardPointer< GuardType >::GetHazardPointerElementForCurrentThread() { ...@@ -240,9 +240,6 @@ HazardPointer< GuardType >::GetHazardPointerElementForCurrentThread() {
// stop operating, and the others are responsible for his retired // stop operating, and the others are responsible for his retired
// list. // list.
HazardPointerThreadEntry_t* current_thread_entry =
&hazard_pointer_thread_entry_array[GetCurrentThreadIndex()];
return hazard_pointer_thread_entry_array[GetCurrentThreadIndex()]; return hazard_pointer_thread_entry_array[GetCurrentThreadIndex()];
} }
......
...@@ -45,19 +45,20 @@ PT_MAIN("Data Structures C++") { ...@@ -45,19 +45,20 @@ PT_MAIN("Data Structures C++") {
unsigned int max_threads = unsigned int max_threads =
static_cast<unsigned int>(2 * partest::TestSuite::GetDefaultNumThreads()); static_cast<unsigned int>(2 * partest::TestSuite::GetDefaultNumThreads());
embb_thread_set_max_count(max_threads); embb_thread_set_max_count(max_threads);
for (;;)
PT_RUN(embb::containers::test::PoolTest< {
embb::containers::WaitFreeArrayValuePool<int COMMA -1> >); PT_RUN(embb::containers::test::PoolTest <
PT_RUN(embb::containers::test::PoolTest< embb::containers::WaitFreeArrayValuePool<int COMMA - 1> > );
embb::containers::LockFreeTreeValuePool<int COMMA -1> >); PT_RUN(embb::containers::test::PoolTest <
embb::containers::LockFreeTreeValuePool<int COMMA - 1> > );
PT_RUN(embb::containers::test::HazardPointerTest); PT_RUN(embb::containers::test::HazardPointerTest);
PT_RUN(embb::containers::test::QueueTest< PT_RUN(embb::containers::test::QueueTest<
embb::containers::WaitFreeSPSCQueue<int> >); embb::containers::WaitFreeSPSCQueue<int> >);
PT_RUN(embb::containers::test::QueueTest< PT_RUN(embb::containers::test::QueueTest <
embb::containers::LockFreeMPMCQueue<int> COMMA true COMMA true >); embb::containers::LockFreeMPMCQueue<int> COMMA true COMMA true > );
PT_RUN(embb::containers::test::StackTest< PT_RUN(embb::containers::test::StackTest<
embb::containers::LockFreeStack<int> >); embb::containers::LockFreeStack<int> >);
...@@ -67,4 +68,5 @@ PT_MAIN("Data Structures C++") { ...@@ -67,4 +68,5 @@ PT_MAIN("Data Structures C++") {
PT_RUN(embb::containers::test::ObjectPoolTest PT_RUN(embb::containers::test::ObjectPoolTest
<embb::containers::WaitFreeArrayValuePool<int COMMA 0> >); <embb::containers::WaitFreeArrayValuePool<int COMMA 0> >);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment