Skip to content

Commit

Permalink
riot-rs-threads: always set threads.current_thread in sched()
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Apr 16, 2024
1 parent 85080cf commit 2084409
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/riot-rs-threads/src/arch/cortex_m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ unsafe fn sched(old_sp: usize) -> usize {
threads.current_thread = Some(next_pid);
current_high_regs = threads.threads[current_pid as usize].data.as_ptr();
} else {
threads.current_thread = Some(next_pid);
current_high_regs = core::ptr::null();
}

Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-threads/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ pub unsafe fn start_threading() {
let cs = unsafe { CriticalSection::new() };
let next_sp = THREADS.with_mut_cs(cs, |mut threads| {
let next_pid = threads.runqueue.get_next().unwrap();
threads.current_thread = Some(next_pid);
threads.threads[next_pid as usize].sp
});
Cpu::start_threading(next_sp);
Expand Down

0 comments on commit 2084409

Please sign in to comment.