projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cff4b91
)
optimize raise not to make a syscall for getting tid
author
Rich Felker
<dalias@aerifal.cx>
Sat, 1 Sep 2018 05:46:44 +0000
(
01:46
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 1 Sep 2018 05:46:44 +0000
(
01:46
-0400)
assuming signals are blocked, which they are here, the tid in the
thread structure is always valid and cannot change out from under us.
src/signal/raise.c
patch
|
blob
|
history
diff --git
a/src/signal/raise.c
b/src/signal/raise.c
index 717b1c917a34311ab514c7955e995c2fbad140b9..f0512019a1921eea797ac84252fd4fd01e3d6d7a 100644
(file)
--- a/
src/signal/raise.c
+++ b/
src/signal/raise.c
@@
-5,11
+5,9
@@
int raise(int sig)
{
- int tid, ret;
sigset_t set;
__block_app_sigs(&set);
- tid = __syscall(SYS_gettid);
- ret = syscall(SYS_tkill, tid, sig);
+ int ret = syscall(SYS_tkill, __pthread_self()->tid, sig);
__restore_sigs(&set);
return ret;
}