From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Waldemar Kozaczuk <jwkozac...@gmail.com>
Branch: master
signal: tag user handler thread as an application one
Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
diff --git a/libc/signal.cc b/libc/signal.cc
--- a/libc/signal.cc
+++ b/libc/signal.cc
@@ -345,6 +345,9 @@ int kill(pid_t pid, int sig)
// very Unix-like behavior, but if we assume that the program
doesn't
// care which of its threads handle the signal - why not just
create
// a completely new thread and run it there...
+ // The newly created thread is tagged as an application one
+ // to make sure that user provided signal handler code has access
to all
+ // the features like syscall stack which matters for Golang apps
const auto sa = signal_actions[sig];
auto t = sched::thread::make([=] {
if (sa.sa_flags & SA_RESETHAND) {
@@ -357,7 +360,8 @@ int kill(pid_t pid, int sig)
} else {
sa.sa_handler(sig);
}
- },
sched::thread::attr().detached().stack(65536).name("signal_handler"));
+ },
sched::thread::attr().detached().stack(65536).name("signal_handler"),
+ false, true);
t->start();
}
return 0;
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/osv-dev/000000000000ca7567058cb4e3a4%40google.com.
For more options, visit https://groups.google.com/d/optout.