did the scheduler need report the misuse of k_sched_lock before k_sleep?


曹子龙
 

hi all:

  i review the code of zephyr of riscv arch, with the aim that to porting this to the mips arch because the reiscv is the most like the mips,  

when i read the function" __irq_wrapper"  , and want to know whether the it should cope with the situation like this:
     ...............
   k_sched_lock();

   k_sleep(1);

   k_sched_unlock();
   ....................


and it obviously wrong because of the paradox, but i found the "__irq_wrapper" would realy do  the actual  switch action with this,  because the flow direct go to the  schedule label when it found the scheduler is involked because of "ecall" in _Swap, with out judge the preempted object, so i want to know if it should be this?

 thanks for your help, and much appreciate for your help.





 

Join devel@lists.zephyrproject.org to automatically receive all group messages.