Minor simplication to last commit; Update TODO list
This commit is contained in:
parent
52fbbaf778
commit
7d9287958f
13
TODO
13
TODO
@ -11,7 +11,7 @@ nuttx/
|
|||||||
|
|
||||||
(13) Task/Scheduler (sched/)
|
(13) Task/Scheduler (sched/)
|
||||||
(1) Memory Management (mm/)
|
(1) Memory Management (mm/)
|
||||||
(4) Signals (sched/signal, arch/)
|
(3) Signals (sched/signal, arch/)
|
||||||
(2) pthreads (sched/pthread)
|
(2) pthreads (sched/pthread)
|
||||||
(0) Message Queues (sched/mqueue)
|
(0) Message Queues (sched/mqueue)
|
||||||
(6) Kernel/Protected Build
|
(6) Kernel/Protected Build
|
||||||
@ -360,17 +360,6 @@ o Signals (sched/signal, arch/)
|
|||||||
Status: Open
|
Status: Open
|
||||||
Priority: Low. Even if there are only 31 usable signals, that is still a lot.
|
Priority: Low. Even if there are only 31 usable signals, that is still a lot.
|
||||||
|
|
||||||
Title: THREAD COMMON SIGNAL HANDLING
|
|
||||||
Description: Signal handlers are assigned on a per thread basis. Signal lists
|
|
||||||
and data structures are a part of the TCB. This is incorrect.
|
|
||||||
Signal handlers are a global property of the task group: The
|
|
||||||
main thread and all of its child threads. Signal handlers for
|
|
||||||
all threads should be attach-able from the main thread, for
|
|
||||||
example.
|
|
||||||
Status: Open
|
|
||||||
Priority: Medium. This is a pretty big violation of the signal handling
|
|
||||||
principles.
|
|
||||||
|
|
||||||
o pthreads (sched/pthreads)
|
o pthreads (sched/pthreads)
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
@ -89,12 +89,11 @@ struct group_signal_s
|
|||||||
static int group_signal_handler(pid_t pid, FAR void *arg)
|
static int group_signal_handler(pid_t pid, FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct group_signal_s *info = (FAR struct group_signal_s *)arg;
|
FAR struct group_signal_s *info = (FAR struct group_signal_s *)arg;
|
||||||
FAR struct task_group_s *group;
|
|
||||||
FAR struct tcb_s *tcb;
|
FAR struct tcb_s *tcb;
|
||||||
FAR sigactq_t *sigact;
|
FAR sigactq_t *sigact;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
DEBUGASSERT(info);
|
DEBUGASSERT(tcb != NULL && tcb->group != NULL && info != NULL);
|
||||||
|
|
||||||
/* Get the TCB associated with the group member */
|
/* Get the TCB associated with the group member */
|
||||||
|
|
||||||
@ -154,10 +153,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
|
|||||||
|
|
||||||
/* Is there also a action associated with the task group? */
|
/* Is there also a action associated with the task group? */
|
||||||
|
|
||||||
group = tcb->group;
|
sigact = sig_findaction(tcb->group, info->siginfo->si_signo);
|
||||||
DEBUGASSERT(group != NULL);
|
|
||||||
|
|
||||||
sigact = sig_findaction(group, info->siginfo->si_signo);
|
|
||||||
if (sigact)
|
if (sigact)
|
||||||
{
|
{
|
||||||
/* Yes.. then use this thread. The requirement is this:
|
/* Yes.. then use this thread. The requirement is this:
|
||||||
|
@ -72,20 +72,17 @@
|
|||||||
|
|
||||||
static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info)
|
||||||
{
|
{
|
||||||
FAR struct task_group_s *group;
|
|
||||||
FAR sigactq_t *sigact;
|
FAR sigactq_t *sigact;
|
||||||
FAR sigq_t *sigq;
|
FAR sigq_t *sigq;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
sched_lock();
|
sched_lock();
|
||||||
|
DEBUGASSERT(stcb != NULL && stcb->group != NULL);
|
||||||
|
|
||||||
/* Find the group sigaction associated with this signal */
|
/* Find the group sigaction associated with this signal */
|
||||||
|
|
||||||
DEBUGASSERT(stcb != NULL && stcb->group != NULL);
|
sigact = sig_findaction(stcb->group, info->si_signo);
|
||||||
|
|
||||||
group = stcb->group;
|
|
||||||
sigact = sig_findaction(group, info->si_signo);
|
|
||||||
|
|
||||||
/* Check if a valid signal handler is available and if the signal is
|
/* Check if a valid signal handler is available and if the signal is
|
||||||
* unblocked. NOTE: There is no default action.
|
* unblocked. NOTE: There is no default action.
|
||||||
@ -202,7 +199,7 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
|
|||||||
FAR sigpendq_t *sigpend = NULL;
|
FAR sigpendq_t *sigpend = NULL;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
DEBUGASSERT(group);
|
DEBUGASSERT(group != NULL);
|
||||||
|
|
||||||
/* Pending sigals can be added from interrupt level. */
|
/* Pending sigals can be added from interrupt level. */
|
||||||
|
|
||||||
@ -232,13 +229,14 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group,
|
|||||||
static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
||||||
FAR siginfo_t *info)
|
FAR siginfo_t *info)
|
||||||
{
|
{
|
||||||
FAR struct task_group_s *group = stcb->group;
|
FAR struct task_group_s *group;
|
||||||
FAR sigpendq_t *sigpend;
|
FAR sigpendq_t *sigpend;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
DEBUGASSERT(group);
|
DEBUGASSERT(stcb != NULL && stcb->group != NULL);
|
||||||
|
group = stcb->group;
|
||||||
|
|
||||||
/* Check if the signal is already pending */
|
/* Check if the signal is already pending for the group */
|
||||||
|
|
||||||
sigpend = sig_findpendingsignal(group, info->si_signo);
|
sigpend = sig_findpendingsignal(group, info->si_signo);
|
||||||
if (sigpend)
|
if (sigpend)
|
||||||
@ -248,7 +246,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
|||||||
memcpy(&sigpend->info, info, sizeof(siginfo_t));
|
memcpy(&sigpend->info, info, sizeof(siginfo_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No... There is nothing pending for this signo */
|
/* No... There is nothing pending in the group for this signo */
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -261,7 +259,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
|
|||||||
|
|
||||||
memcpy(&sigpend->info, info, sizeof(siginfo_t));
|
memcpy(&sigpend->info, info, sizeof(siginfo_t));
|
||||||
|
|
||||||
/* Add the structure to the pending signal list */
|
/* Add the structure to the group pending signal list */
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
sq_addlast((FAR sq_entry_t *)sigpend, &group->tg_sigpendingq);
|
sq_addlast((FAR sq_entry_t *)sigpend, &group->tg_sigpendingq);
|
||||||
|
Loading…
Reference in New Issue
Block a user