<p dir="auto">by <strong>smirolo</strong>:</p>
<pre class="notranslate">I looked forward to try out go now that it is an official language supported by gcc but
the code failed to compile on OSX10.6.7+i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple
Inc. build 5666).

I apologize if the bug should be reported somewhere else (as well? instead of here?). As
the build panel shows an "ok" for darwin systems, I assume there has been a
solution already published. Unfortunately I cannot find any tag matching the released
gcc-4.6.0 so I do not know if it is expected to fail. I couldn't find any information
either on how the hg go repository makes it into the official gcc release so it is
really hard to guess whose bug it is and where a workaround is supposed to live.

curl -O ftp://mirrors.kernel.org/gnu/gcc/gcc-4.6.0/gcc-4.6.0.tar.bz2
tar jxvf gcc-4.6.0.tar.bz2
mkdir -p gcc-4.6.0-build
cd gcc-4.6.0-build
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/opt/local/bin
~/build/gcc-4.6.0/configure --enable-languages=c,c++,go --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc=/opt/local --prefix=${HOME}/build/install/gccgo
make
...
~/build/gcc-4.6.0/libgo/runtime/go-go.c: In function ‘runtime_stoptheworld’:
~/build/gcc-4.6.0/libgo/runtime/go-go.c:386:29: error: ‘SIGRTMIN’ undeclared (first
use in this function)
...

SIGRTMIN as per wikipedia (<a href="http://en.wikipedia.org/wiki/SIGRTMIN_and_SIGRTMAX)" rel="nofollow">http://en.wikipedia.org/wiki/SIGRTMIN_and_SIGRTMAX)</a> is
standard POSIX. Unfortunately it isn't defined anywhere on my OSX 10.6.7 system.
grep -r SIGRTMIN /usr/include
[nothing]
More searching actually reveal that real-time signals are not supported on OSX...</pre>
<pre class="notranslate">It would be nice if RUnlock() panicked if called when the mutex is not read locked,
similar to how Unlock() panics when the mutex is not write locked. As it is, bugs
related to mismatched rlocking are harder to find. The documentation states that
"It is a run-time error if rw is not locked for reading on entry to RUnlock."
which I interpret as we intended this to panic.

Go v1.2.1

The program:

<a href="http://play.golang.org/p/GmAqwC5WJo" rel="nofollow">http://play.golang.org/p/GmAqwC5WJo</a>

Now prints:

Read locked
Also, write locked

While I would expect it to panic on line 10.</pre>