]> Cypherpunks repositories - gostls13.git/commit
runtime: retry thread creation on EAGAIN
authorIan Lance Taylor <iant@golang.org>
Tue, 1 Nov 2022 23:04:50 +0000 (16:04 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 10 Nov 2022 20:44:45 +0000 (20:44 +0000)
commit14018c8becc385f79f62f9cdf24cab93fe3e0cdc
tree74490921a6f54463f4b3d561afb5190ebe75f9b1
parentd96eb826cb7cd4fe36745e3b1a79e0a2571acc4a
runtime: retry thread creation on EAGAIN

This copies the logic we use in runtime/cgo, when calling pthread_create,
into runtime proper, when calling newosproc.

We only do this in newosproc, not newosproc0, because in newosproc0 we
need a nosplit function literal, and we need to pass arguments to it through
newosproc, which is a pain. Also newosproc0 is only called at process
startup, when thread creation is less likely to fail anyhow.

Fixes #49438

Change-Id: Ia26813952fdbae8aaad5904c9102269900a07ba9
Reviewed-on: https://go-review.googlesource.com/c/go/+/447175
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/runtime/os3_solaris.go
src/runtime/os_aix.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd_libc.go
src/runtime/os_openbsd_syscall.go
src/runtime/retry.go [new file with mode: 0644]