Commit 5044f0a1 by FritzFlorian

Fix: test that invalidly referenced stack memory.

parent be2cdbfe
Pipeline #1250 failed with stages
in 3 minutes 38 seconds
...@@ -19,17 +19,15 @@ task::task(const task &other) : ...@@ -19,17 +19,15 @@ task::task(const task &other) :
deque_state_{other.deque_state_} {} deque_state_{other.deque_state_} {}
void task::execute() { void task::execute() {
{ PROFILE_WORK_BLOCK("execute task")
PROFILE_WORK_BLOCK("execute task") auto last_executing = thread_state::get()->current_task_;
auto last_executing = thread_state::get()->current_task_; thread_state::get()->current_task_ = this;
thread_state::get()->current_task_ = this;
execute_internal(); execute_internal();
PROFILE_END_BLOCK
thread_state::get()->current_task_ = last_executing;
}
wait_for_all(); wait_for_all();
thread_state::get()->current_task_ = last_executing;
if (parent_ != nullptr) { if (parent_ != nullptr) {
parent_->ref_count_--; parent_->ref_count_--;
......
...@@ -70,6 +70,9 @@ TEST_CASE("tbb task are scheduled correctly", "[internal/scheduling/fork_join_ta ...@@ -70,6 +70,9 @@ TEST_CASE("tbb task are scheduled correctly", "[internal/scheduling/fork_join_ta
std::atomic<int> dummy_parent{1}, overall_counter{8}; std::atomic<int> dummy_parent{1}, overall_counter{8};
force_steal_sub_task sub_task{&dummy_parent, &overall_counter}; force_steal_sub_task sub_task{&dummy_parent, &overall_counter};
scheduler::spawn_child(sub_task); scheduler::spawn_child(sub_task);
// Required, as child operates on our stack's memory!!!
scheduler::wait_for_all();
}); });
my_scheduler.terminate(true); my_scheduler.terminate(true);
} }
......
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