]> Cypherpunks.ru repositories - gostls13.git/commit
runtime/cgo: merge bodies of cgo_sys_thread_start on windows
authorMichael Pratt <mpratt@google.com>
Fri, 3 Jun 2022 20:03:55 +0000 (16:03 -0400)
committerMichael Pratt <mpratt@google.com>
Thu, 9 Jun 2022 18:17:39 +0000 (18:17 +0000)
commit91019cc13d9de72d5e43a0068311dc9e6012777a
tree4445bedcddebe01b50acb5803d24b47ccef1f807
parent840e99ed742e55ddd00a57210a706e14234c8bc5
runtime/cgo: merge bodies of cgo_sys_thread_start on windows

The bodies of cgo_sys_thread_start (and x_cgo_sys_thread_create) are
nearly identical on all of the windows ports.

Create a single _cgo_beginthread implementation that contains the body
and is used on all ports. This will reduce churn in an upcoming CL to
add retry logic.

We could theoretically have a single implementation of
_cgo_sys_thread_start shared by all ports, but I keep them separate for
ease of searching. Right now every single port implements this function
in their gcc_GOOS_GOARCH.c file, so it is nice to keep this symmetry.

_cgo_dummy_export must move out of libcgo_windows.h because it is a
definition and the inclusion of libcgo_windows.h in multiple files
creates duplicate definitions.

For #52572.

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