diff --git a/test/freelist_test.cpp b/test/freelist_test.cpp index ad8ee99..4eb9c5c 100644 --- a/test/freelist_test.cpp +++ b/test/freelist_test.cpp @@ -190,6 +190,10 @@ struct freelist_tester if (running.load() == false) break; + +#ifdef __VXWORKS__ + boost::thread::yield(); +#endif } dummy * node; diff --git a/test/spsc_queue_stress_test.cpp b/test/spsc_queue_stress_test.cpp index 399b2f3..a63afd0 100644 --- a/test/spsc_queue_stress_test.cpp +++ b/test/spsc_queue_stress_test.cpp @@ -36,7 +36,12 @@ struct spsc_queue_tester boost::lockfree::detail::atomic spsc_queue_cnt, received_nodes; +// In VxWorks one RTP just supports 65535 objects +#ifndef __VXWORKS__ static_hashed_set working_set; +#else + static_hashed_set working_set; +#endif spsc_queue_tester(void): spsc_queue_cnt(0), received_nodes(0) @@ -118,7 +123,13 @@ struct spsc_queue_tester_buffering boost::lockfree::detail::atomic spsc_queue_cnt; +// In VxWorks one RTP just supports 65535 objects +#ifndef __VXWORKS__ static_hashed_set working_set; +#else + static_hashed_set working_set; +#endif + boost::lockfree::detail::atomic received_nodes; spsc_queue_tester_buffering(void): diff --git a/test/test_common.hpp b/test/test_common.hpp index 6925fcd..2db41a8 100644 --- a/test/test_common.hpp +++ b/test/test_common.hpp @@ -51,11 +51,17 @@ struct queue_stress_tester assert(inserted); if (Bounded) - while(stk.bounded_push(id) == false) - /*thread::yield()*/; + while(stk.bounded_push(id) == false) { +#ifdef __VXWORKS__ + thread::yield(); +#endif + } else - while(stk.push(id) == false) - /*thread::yield()*/; + while(stk.push(id) == false) { +#ifdef __VXWORKS__ + thread::yield(); +#endif + } ++push_count; } writers_finished += 1; @@ -90,6 +96,10 @@ struct queue_stress_tester if ( writers_finished.load() == writer_threads ) break; + +#ifdef __VXWORKS__ + thread::yield(); +#endif } while (consume_element(q));