Ian Lance Taylor <[email protected]> writes:
> This patch changes the Go library to multiplex goroutines onto operating
> system threads. Previously, each new goroutine ran in a separate
> thread. That is inefficient for programs with lots of goroutines. This
> patch changes the library such that it runs a certain numbers of
> threads, and lets each thread switch between goroutines. This is how
> the master Go library works, and this patch brings in code from the
> master Go library, adjusted for use by gccgo.
[...]
> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Tested
> both with and without -fsplit-stack support. Committed to mainline.
Unfortunately, this patch broke Solaris bootstrap (and would break IRIX
bootstrap if this ever started working again):
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-signal.c:221:1: error: conflicting
types for 'sigignore'
In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/go-signal.c:7:0:
/var/gcc/regression/trunk/8-gcc/build/./gcc/include-fixed/signal.h:100:12: note:
previous declaration of 'sigignore' was here
make[4]: *** [go-signal.lo] Error 1
<signal.h> on all of Solaris, IRIX, and Tru64 UNIX has
extern int sigignore(int);
I've fixed this by using sig_ignore instead.
Rainer
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -218,7 +218,7 @@ sighandler (int sig)
/* Ignore a signal. */
static void
-sigignore (int sig __attribute__ ((unused)))
+sig_ignore (int sig __attribute__ ((unused)))
{
}
@@ -247,7 +247,7 @@ runtime_initsig (int32 queue)
if (signals[i].catch || signals[i].queue)
sa.sa_handler = sighandler;
else
- sa.sa_handler = sigignore;
+ sa.sa_handler = sig_ignore;
sa.sa_flags = signals[i].restart ? SA_RESTART : 0;
if (sigaction (signals[i].sig, &sa, NULL) != 0)
__go_assert (0);
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University