]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: retry pthread_create on EAGAIN for OpenBSD
authorIan Lance Taylor <iant@golang.org>
Mon, 5 Dec 2016 19:17:59 +0000 (11:17 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 5 Dec 2016 21:15:05 +0000 (21:15 +0000)
commit80acfe950fce409477b9fae097696701a9ff66e3
tree94834f5181476678935b6dd51e6e907d77745f63
parenta303f05f863af89641cf9ba815f418e5bc3ec9dd
runtime/cgo: retry pthread_create on EAGAIN for OpenBSD

For reasons that I do not know, OpenBSD does not call pthread_create
directly, but instead looks it up in libpthread.so. That means that we
can't use the code used on other systems to retry pthread_create on
EAGAIN, since that code simply calls pthread_create.

This patch copies that code to an OpenBSD-specific version.

Also, check for an EAGAIN failure in the test, as that seems to be the
underlying cause of the test failure on several systems including OpenBSD.

Fixes #18146.

Change-Id: I3bceaa1e03a7eaebc2da19c9cc146b25b59243ef
Reviewed-on: https://go-review.googlesource.com/33905
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/cgo/test/issue18146.go
src/runtime/cgo/gcc_libinit_openbsd.c
src/runtime/cgo/gcc_openbsd_386.c
src/runtime/cgo/gcc_openbsd_amd64.c
src/runtime/cgo/libcgo_unix.h