diff options
| author | Shenghou Ma <minux.ma@gmail.com> | 2013-07-12 04:39:39 +0800 |
|---|---|---|
| committer | Shenghou Ma <minux.ma@gmail.com> | 2013-07-12 04:39:39 +0800 |
| commit | 2f1ead709548873463b93de549839d3acbd27633 (patch) | |
| tree | ce477e0b85560f067e4c77d1216d39e6de314172 /src/pkg/runtime/sigqueue.goc | |
| parent | 2a983aa3117a1647be2759edad8643cfdd5c7398 (diff) | |
| download | go-2f1ead709548873463b93de549839d3acbd27633.tar.xz | |
runtime: correctly handle signals received on foreign threads
Fixes #3250.
R=rsc
CC=golang-dev
https://golang.org/cl/10757044
Diffstat (limited to 'src/pkg/runtime/sigqueue.goc')
| -rw-r--r-- | src/pkg/runtime/sigqueue.goc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/runtime/sigqueue.goc b/src/pkg/runtime/sigqueue.goc index 7e083685d0..9bfab3bfae 100644 --- a/src/pkg/runtime/sigqueue.goc +++ b/src/pkg/runtime/sigqueue.goc @@ -28,6 +28,7 @@ package runtime #include "runtime.h" #include "defs_GOOS_GOARCH.h" #include "os_GOOS.h" +#include "cgocall.h" static struct { Note; @@ -155,3 +156,11 @@ func signal_disable(s uint32) { sig.wanted[s/32] &= ~(1U<<(s&31)); runtime·sigdisable(s); } + +// This runs on a foreign stack, without an m or a g. No stack split. +#pragma textflag 7 +void +runtime·badsignal(uintptr sig) +{ + runtime·cgocallback((void (*)(void))runtime·sigsend, &sig, sizeof(sig)); +} |
