Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
7d928795
Commit
7d928795
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Minor simplication to last commit; Update TODO list
parent
52fbbaf7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
TODO
+1
-12
1 addition, 12 deletions
TODO
sched/group/group_signal.c
+2
-6
2 additions, 6 deletions
sched/group/group_signal.c
sched/signal/sig_dispatch.c
+9
-11
9 additions, 11 deletions
sched/signal/sig_dispatch.c
with
12 additions
and
29 deletions
TODO
+
1
−
12
View file @
7d928795
...
...
@@ -11,7 +11,7 @@ nuttx/
(13) Task/Scheduler (sched/)
(1) Memory Management (mm/)
(
4
) Signals (sched/signal, arch/)
(
3
) Signals (sched/signal, arch/)
(2) pthreads (sched/pthread)
(0) Message Queues (sched/mqueue)
(6) Kernel/Protected Build
...
...
@@ -360,17 +360,6 @@ o Signals (sched/signal, arch/)
Status: Open
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)
^^^^^^^^^^^^^^^^^
...
...
This diff is collapsed.
Click to expand it.
sched/group/group_signal.c
+
2
−
6
View file @
7d928795
...
...
@@ -89,12 +89,11 @@ struct group_signal_s
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
task_group_s
*
group
;
FAR
struct
tcb_s
*
tcb
;
FAR
sigactq_t
*
sigact
;
int
ret
;
DEBUGASSERT
(
info
);
DEBUGASSERT
(
tcb
!=
NULL
&&
tcb
->
group
!=
NULL
&&
info
!=
NULL
);
/* 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? */
group
=
tcb
->
group
;
DEBUGASSERT
(
group
!=
NULL
);
sigact
=
sig_findaction
(
group
,
info
->
siginfo
->
si_signo
);
sigact
=
sig_findaction
(
tcb
->
group
,
info
->
siginfo
->
si_signo
);
if
(
sigact
)
{
/* Yes.. then use this thread. The requirement is this:
...
...
This diff is collapsed.
Click to expand it.
sched/signal/sig_dispatch.c
+
9
−
11
View file @
7d928795
...
...
@@ -72,20 +72,17 @@
static
int
sig_queueaction
(
FAR
struct
tcb_s
*
stcb
,
siginfo_t
*
info
)
{
FAR
struct
task_group_s
*
group
;
FAR
sigactq_t
*
sigact
;
FAR
sigq_t
*
sigq
;
irqstate_t
flags
;
int
ret
=
OK
;
sched_lock
();
DEBUGASSERT
(
stcb
!=
NULL
&&
stcb
->
group
!=
NULL
);
/* Find the group sigaction associated with this signal */
DEBUGASSERT
(
stcb
!=
NULL
&&
stcb
->
group
!=
NULL
);
group
=
stcb
->
group
;
sigact
=
sig_findaction
(
group
,
info
->
si_signo
);
sigact
=
sig_findaction
(
stcb
->
group
,
info
->
si_signo
);
/* Check if a valid signal handler is available and if the signal is
* 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
;
irqstate_t
flags
;
DEBUGASSERT
(
group
);
DEBUGASSERT
(
group
!=
NULL
);
/* 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
,
FAR
siginfo_t
*
info
)
{
FAR
struct
task_group_s
*
group
=
stcb
->
group
;
FAR
struct
task_group_s
*
group
;
FAR
sigpendq_t
*
sigpend
;
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
);
if
(
sigpend
)
...
...
@@ -248,7 +246,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
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
{
...
...
@@ -261,7 +259,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb,
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
();
sq_addlast
((
FAR
sq_entry_t
*
)
sigpend
,
&
group
->
tg_sigpendingq
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment