]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: retry _beginthread on EACCES
authorMichael Pratt <mpratt@google.com>
Fri, 3 Jun 2022 20:22:58 +0000 (16:22 -0400)
committerMichael Pratt <mpratt@google.com>
Thu, 9 Jun 2022 18:17:45 +0000 (18:17 +0000)
commitc7ccabf3fea67f002bef190a5ffc7417f4371a23
treeb65c92038821d560df2ba967bc97ef502f02c6b8
parent91019cc13d9de72d5e43a0068311dc9e6012777a
runtime/cgo: retry _beginthread on EACCES

We occassionally see _beginthread failing with EACCES, meaning
"insufficient resources" according to the Microsoft documentation.
Exactly which resources is unclear.

Similar to pthread_create on unix systems, we can wait a bit and retry
to try to get success. The alternative is to abort, so we may as well
give it a try.

Fixes #52572.

Change-Id: I6e05add53b4ae36c61e53b1ee3fed6bc74e17dfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/410355
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/runtime/cgo/gcc_libinit_windows.c