mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
committed by
Alin Jerpelea
parent
94da3e4c3a
commit
7f2317e90a
@@ -114,14 +114,15 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
* is the same as the one that must receive the signal, then we will
|
* is the same as the one that must receive the signal, then we
|
||||||
* have to modify the return state as well as the state in the TCB.
|
* will have to modify the return state as well as the state in the
|
||||||
|
* TCB.
|
||||||
*
|
*
|
||||||
* Hmmm... there looks like a latent bug here: The following logic
|
* Hmmm... there looks like a latent bug here: The following logic
|
||||||
* would fail in the strange case where we are in an interrupt
|
* would fail in the strange case where we are in an interrupt
|
||||||
* handler, the thread is signalling itself, but a context switch to
|
* handler, the thread is signalling itself, but a context switch
|
||||||
* another task has occurred so that g_current_regs does not refer to
|
* to another task has occurred so that g_current_regs does not
|
||||||
* the thread of this_task()!
|
* refer to the thread of this_task()!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -106,20 +106,23 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||||||
|
|
||||||
if (!g_current_regs)
|
if (!g_current_regs)
|
||||||
{
|
{
|
||||||
/* In this case just deliver the signal with a function call now. */
|
/* In this case just deliver the signal with a function call
|
||||||
|
* now.
|
||||||
|
*/
|
||||||
|
|
||||||
sigdeliver(tcb);
|
sigdeliver(tcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
/* CASE 2: We are in an interrupt handler AND the interrupted task
|
||||||
* is the same as the one that must receive the signal, then we will
|
* is the same as the one that must receive the signal, then we
|
||||||
* have to modify the return state as well as the state in the TCB.
|
* will have to modify the return state as well as the state in the
|
||||||
|
* TCB.
|
||||||
*
|
*
|
||||||
* Hmmm... there looks like a latent bug here: The following logic
|
* Hmmm... there looks like a latent bug here: The following logic
|
||||||
* would fail in the strange case where we are in an interrupt
|
* would fail in the strange case where we are in an interrupt
|
||||||
* handler, the thread is signalling itself, but a context switch to
|
* handler, the thread is signalling itself, but a context switch
|
||||||
* another task has occurred so that g_current_regs does not refer to
|
* to another task has occurred so that g_current_regs does not
|
||||||
* the thread of this_task()!
|
* refer to the thread of this_task()!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user