sched/sched: simplify the implementation of the function nxsched_readytorun_setpriority
Summary
If the type of tcb is TSTATE_TASK_ASSIGNED, removing it using nxsched_remove_not_running and then putting it back into the queue may result in a context switch.
Impact
Testing
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.
@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.
The bug was found during our internal monkey testing. In some cases, it would trigger DEBUGASSERT(check == false), so we changed it to a more general implementation and passed the internal monkey testing.
@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.
do you have better suggestion? @masayuki2009