aboutsummaryrefslogtreecommitdiff
path: root/src/signal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-01 01:46:44 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-01 01:46:44 -0400
commit0b4c92b7acf63529858e7f8a3bb6505cd2b6e962 (patch)
treebb0cb0e462edcd13840b6bad2b351788fae1b496 /src/signal
parentcff4b910ab210e5c35f768c75c4562b3ae3e86f2 (diff)
downloadmusl-0b4c92b7acf63529858e7f8a3bb6505cd2b6e962.zip
musl-0b4c92b7acf63529858e7f8a3bb6505cd2b6e962.tar.gz
musl-0b4c92b7acf63529858e7f8a3bb6505cd2b6e962.tar.bz2
optimize raise not to make a syscall for getting tid
assuming signals are blocked, which they are here, the tid in the thread structure is always valid and cannot change out from under us.
Diffstat (limited to 'src/signal')
-rw-r--r--src/signal/raise.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/signal/raise.c b/src/signal/raise.c
index 717b1c9..f051201 100644
--- 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;
}