From: Rich Felker Date: Sat, 1 Sep 2018 05:46:44 +0000 (-0400) Subject: optimize raise not to make a syscall for getting tid X-Git-Tag: v1.1.20~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0b4c92b7acf63529858e7f8a3bb6505cd2b6e962;p=oweals%2Fmusl.git 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. --- diff --git a/src/signal/raise.c b/src/signal/raise.c index 717b1c91..f0512019 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; }