resolved the uninit variable issue in the queue_test

master
Francisco Paisana 5 years ago committed by Andre Puschmann
parent 14267640ee
commit 7e67aee839

@ -104,7 +104,7 @@ int test_multiqueue_threading()
{ {
std::cout << "\n===== TEST multiqueue threading test: start =====\n"; std::cout << "\n===== TEST multiqueue threading test: start =====\n";
int capacity = 4, number, start_number = 2, nof_pushes = capacity + 1; int capacity = 4, number = 0, start_number = 2, nof_pushes = capacity + 1;
multiqueue_handler<int> multiqueue(capacity); multiqueue_handler<int> multiqueue(capacity);
int qid1 = multiqueue.add_queue(); int qid1 = multiqueue.add_queue();
auto push_blocking_func = [&multiqueue](int qid, int start_value, int nof_pushes, bool* is_running) { auto push_blocking_func = [&multiqueue](int qid, int start_value, int nof_pushes, bool* is_running) {
@ -190,9 +190,9 @@ int test_multiqueue_threading3()
multiqueue_handler<int> multiqueue(capacity); multiqueue_handler<int> multiqueue(capacity);
int qid1 = multiqueue.add_queue(); int qid1 = multiqueue.add_queue();
auto pop_blocking_func = [&multiqueue](int qid, bool* success) { auto pop_blocking_func = [&multiqueue](int qid, bool* success) {
int number; int number = 0;
int id = multiqueue.wait_pop(&number); int id = multiqueue.wait_pop(&number);
*success = id < 0; *success = id < 0;
}; };
bool t1_success = false; bool t1_success = false;

@ -208,8 +208,9 @@ void ue_stack_lte::run_thread()
{ {
while (running) { while (running) {
task_t task{}; task_t task{};
pending_tasks.wait_pop(&task); if (pending_tasks.wait_pop(&task) >= 0) {
task(); task();
}
} }
} }

Loading…
Cancel
Save