Skip to content

Commit fa2679f

Browse files
committed
fix: stop-token not resetted on start
1 parent 65ac765 commit fa2679f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/modm/processing/fiber/stop_token.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ class stop_state
5252
return not requested.exchange(true, std::memory_order_relaxed);
5353
}
5454

55+
bool inline
56+
reset_stop()
57+
{
58+
return not requested.exchange(true, std::memory_order_relaxed);
59+
}
60+
5561
constexpr stop_source
5662
get_source();
5763

src/modm/processing/fiber/task_impl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Task::start()
6767
{
6868
if (isRunning()) return false;
6969
modm_context_reset(&ctx);
70+
stop.reset_stop();
7071
Scheduler::instance().add(this);
7172
return true;
7273
}

0 commit comments

Comments
 (0)