diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
commit | 8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5 (patch) | |
tree | ba71646a10b518372d110532d86fcf0b98edc14f /src/pkg/runtime/cgo/gcc_linux_arm.c | |
parent | 3bb719bbf3cdb97b3901f3baaa2da9d02a5c3cdb (diff) | |
parent | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (diff) | |
download | golang-8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5.tar.gz |
Merge tag 'upstream/1.3' into debian-sid
Upstream version 1.3
Diffstat (limited to 'src/pkg/runtime/cgo/gcc_linux_arm.c')
-rw-r--r-- | src/pkg/runtime/cgo/gcc_linux_arm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pkg/runtime/cgo/gcc_linux_arm.c b/src/pkg/runtime/cgo/gcc_linux_arm.c index 9a6e58594..032568155 100644 --- a/src/pkg/runtime/cgo/gcc_linux_arm.c +++ b/src/pkg/runtime/cgo/gcc_linux_arm.c @@ -4,6 +4,7 @@ #include <pthread.h> #include <string.h> +#include <signal.h> #include "libcgo.h" static void *threadentry(void*); @@ -28,10 +29,14 @@ void _cgo_sys_thread_start(ThreadStart *ts) { pthread_attr_t attr; + sigset_t ign, oset; pthread_t p; size_t size; int err; + sigfillset(&ign); + pthread_sigmask(SIG_SETMASK, &ign, &oset); + // Not sure why the memset is necessary here, // but without it, we get a bogus stack size // out of pthread_attr_getstacksize. C'est la Linux. @@ -41,6 +46,9 @@ _cgo_sys_thread_start(ThreadStart *ts) pthread_attr_getstacksize(&attr, &size); ts->g->stackguard = size; err = pthread_create(&p, &attr, threadentry, ts); + + pthread_sigmask(SIG_SETMASK, &oset, nil); + if (err != 0) { fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err)); abort(); |