xiaoxiang781216 commented on pull request #5731:
URL: https://github.com/apache/incubator-nuttx/pull/5731#issuecomment-1080774112


   But the thread stack also switch out. For example, let's assume that the 
user space thread call semwait and the count of sem is zero:
   
   1. Task 1 run on stack 1 call sem_wait and then trigger ecall
   2. The ecall handler switch to S-mode and dispatch to nxsem_wait
   3. nxsem_wait continue execute on stack 1
   4. up_block_task is called since the count is zero
   5. group_addrenv switch the address space to the next task
   6. But the current SP isn't changed and still point to the stack 1(of 
course, it isn't the memory of stack 1 anymore, but somewhere in task 2 memory 
space).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to