Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8c739876
Commit
8c739876
authored
Sep 28, 2002
by
Ingo Molnar
Committed by
Jeff Garzik
Sep 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] signal delivery to thread groups bugfix
Fix thread group signal sending
parent
aa016b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
kernel/signal.c
kernel/signal.c
+21
-9
No files found.
kernel/signal.c
View file @
8c739876
...
...
@@ -874,9 +874,23 @@ int __broadcast_thread_group(struct task_struct *p, int sig)
return
err
;
}
struct
task_struct
*
find_unblocked_thread
(
struct
task_struct
*
p
,
int
signr
)
{
struct
task_struct
*
tmp
;
struct
list_head
*
l
;
struct
pid
*
pid
;
for_each_task_pid
(
p
->
tgid
,
PIDTYPE_TGID
,
tmp
,
l
,
pid
)
if
(
!
sigismember
(
&
tmp
->
blocked
,
signr
)
&&
!
sigismember
(
&
tmp
->
real_blocked
,
signr
))
return
tmp
;
return
NULL
;
}
int
send_sig_info
(
int
sig
,
struct
siginfo
*
info
,
struct
task_struct
*
p
)
{
struct
task_struct
*
t
;
unsigned
long
flags
;
int
ret
=
0
;
...
...
@@ -905,21 +919,19 @@ send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
if
(
sig_ignored
(
p
,
sig
))
goto
out_unlock
;
/* blocked (or ptraced) signals get posted */
spin_lock
(
&
p
->
sigmask_lock
);
if
((
p
->
ptrace
&
PT_PTRACED
)
||
sigismember
(
&
p
->
blocked
,
sig
)
||
sigismember
(
&
p
->
real_blocked
,
sig
))
{
spin_unlock
(
&
p
->
sigmask_lock
);
if
(
sig_kernel_specific
(
sig
))
goto
out_send
;
}
spin_unlock
(
&
p
->
sigmask_lock
);
/* Does any of the threads unblock the signal? */
t
=
find_unblocked_thread
(
p
,
sig
);
if
(
!
t
)
{
ret
=
__send_sig_info
(
sig
,
info
,
p
,
1
);
goto
out_unlock
;
}
if
(
sig_kernel_broadcast
(
sig
)
||
sig_kernel_coredump
(
sig
))
{
ret
=
__broadcast_thread_group
(
p
,
sig
);
goto
out_unlock
;
}
if
(
sig_kernel_specific
(
sig
))
goto
out_send
;
/* must not happen */
BUG
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment