Files
visor/pkg/sync
Adin ScannellandgVisor bot 20d6db369e Restore template rendering and switch Go internal facts to be rendered.
Since switching to checkconst style static analysis for constants imported from
Go internal pkgs, we've seen a proliferation of duplicate files for various Go
versions. This is not an ideal state of affairs, and results in needless time
spent keeping Go and gVisor in sync WRT to these constants.

To fix this problem, this CL restores template rendering. Instead of going back
to the original implementation where we had separate .tmpl files, this CL uses
Adin's unused implementation of integrating template generation into Go
comments. This allows these files to be parsed as normal by other tools, and
results in not needing separate nogo_facts blaze targets just for template
files.

For simplicity and versatility I have decided to retain the checkconst
annotations. While there don't seem to be that many cases where having
+checkconst annotations over rendering is an improvement (one such case is in
runtime_go12\d_unsafe.go) there may be other such cases in the future.  The
template rendering is done via the checkconst analyzer, so there is no redundant
information.

This CL mainly focuses on removing duplicate files per Go version, so other uses
of checkconst annotations that reference internal gvisor pkgs are kept as-is
(e.g. bluepill_.*.s, entry_.*.s, etc.).

PiperOrigin-RevId: 861305642
2026-01-26 12:28:13 -08:00
..
2025-08-22 14:27:14 +08:00
2020-01-09 22:02:24 -08:00
2020-07-12 17:22:08 -07:00

sync

This package provides additional synchronization primitives not provided by the Go stdlib 'sync' package. It is partially derived from the upstream 'sync' package from go1.10.