Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build !checklocks
|
||||
// +build !checklocks
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build checklocks
|
||||
// +build checklocks
|
||||
|
||||
+5
-4
@@ -110,8 +110,8 @@ func (g *Gate) leaveClosed() {
|
||||
if atomic.LoadUintptr(&g.closingG) == 0 {
|
||||
return
|
||||
}
|
||||
if g := atomic.SwapUintptr(&g.closingG, 0); g > preparingG {
|
||||
goready(g, 0)
|
||||
if cG := atomic.SwapUintptr(&g.closingG, 0); cG > preparingG {
|
||||
goready(cG, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,8 +133,8 @@ func (g *Gate) Close() {
|
||||
panic("concurrent Close of sync.Gate")
|
||||
}
|
||||
|
||||
if g := atomic.SwapUintptr(&g.closingG, preparingG); g != 0 {
|
||||
panic(fmt.Sprintf("invalid sync.Gate.closingG during Close: %#x", g))
|
||||
if cG := atomic.SwapUintptr(&g.closingG, preparingG); cG != 0 {
|
||||
panic(fmt.Sprintf("invalid sync.Gate.closingG during Close: %#x", cG))
|
||||
}
|
||||
if atomic.LoadInt32(&g.userCount) == math.MinInt32 {
|
||||
// The last call to Leave arrived while we were setting up closingG.
|
||||
@@ -142,6 +142,7 @@ func (g *Gate) Close() {
|
||||
}
|
||||
// WaitReasonSemacquire/TraceBlockSync are consistent with WaitGroup.
|
||||
gopark(gateCommit, gohacks.Noescape(unsafe.Pointer(&g.closingG)), WaitReasonSemacquire, TraceBlockSync, 0)
|
||||
RaceAcquire(unsafe.Pointer(&g.closingG))
|
||||
}
|
||||
|
||||
//go:norace
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build go1.13 && !go1.14
|
||||
// +build go1.13,!go1.14
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build go1.14
|
||||
// +build go1.14
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build !race
|
||||
// +build !race
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
TEXT ·RaceUncheckedAtomicCompareAndSwapUintptr(SB),NOSPLIT,$0-25
|
||||
MOVD ptr+0(FP), R0
|
||||
MOVD old+8(FP), R1
|
||||
MOVD new+16(FP), R1
|
||||
MOVD new+16(FP), R2
|
||||
again:
|
||||
LDAXR (R0), R3
|
||||
CMP R1, R3
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build race
|
||||
// +build race
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build amd64
|
||||
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ package sync
|
||||
|
||||
// Values for the reason argument to gopark, from Go's src/runtime/runtime2.go.
|
||||
const (
|
||||
WaitReasonSelect uint8 = 9 // +checkconst runtime waitReasonSelect
|
||||
WaitReasonChanReceive uint8 = 14 // +checkconst runtime waitReasonChanReceive
|
||||
WaitReasonSemacquire uint8 = 18 // +checkconst runtime waitReasonSemacquire
|
||||
WaitReasonSelect uint8 = 18
|
||||
WaitReasonChanReceive uint8 = 19
|
||||
WaitReasonSemacquire uint8 = 13
|
||||
)
|
||||
+2
-2
@@ -16,6 +16,6 @@ package sync
|
||||
|
||||
// TraceBlockReason constants, from Go's src/runtime/trace2runtime.go.
|
||||
const (
|
||||
TraceBlockSelect TraceBlockReason = 3 // +checkconst runtime traceBlockSelect
|
||||
TraceBlockSync TraceBlockReason = 5 // +checkconst runtime traceBlockSync
|
||||
TraceBlockSelect TraceBlockReason = 3
|
||||
TraceBlockSync TraceBlockReason = 5
|
||||
)
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2023 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build go1.21 && !go1.24
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
// Copyright 2024 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build go1.24
|
||||
// https://go.dev/cl/691596 (1.26) renames the internal map type which nogo relies on.
|
||||
//go:build go1.24 && !go1.26
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2024 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
// https://go.dev/cl/691596 (1.26) renames the internal map type which nogo relies on.
|
||||
//go:build go1.26
|
||||
|
||||
package sync
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// Use checkoffset to assert that maptype.hasher (the only field we use) has
|
||||
// the correct offset.
|
||||
const maptypeHasherOffset = unsafe.Offsetof(maptype{}.Hasher) // +checkoffset internal/abi MapType.Hasher
|
||||
@@ -1,7 +1,8 @@
|
||||
// Copyright 2023 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
// runtime.maptype is moved to internal/abi.MapType in Go 1.21.
|
||||
//
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
//go:build !amd64
|
||||
// +build !amd64
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
#define NMSPINNING_OFFSET 92 // +checkoffset runtime schedt.nmspinning
|
||||
#define NMSPINNING_OFFSET 116
|
||||
|
||||
TEXT ·addrOfSpinning(SB),NOSPLIT|NOFRAME,$0-8
|
||||
LEAQ runtime·sched(SB), AX
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2023 The gVisor Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !amd64
|
||||
|
||||
// This file is intentionally left blank. arm64 doesn't use
|
||||
// addrOfSpinning, but we still need an input to the nogo template rule.
|
||||
@@ -15,4 +15,10 @@
|
||||
//go:build !amd64
|
||||
|
||||
// This file is intentionally left blank. Other arches don't use
|
||||
// addrOfSpinning, but we still need an input to the nogo template rule.
|
||||
// addrOfSpinning, but because this package is partially used in Netstack, we
|
||||
// should support arches that aren't amd64 or arm64. Having this file here
|
||||
// ensures that `go build` doesn't compile the package with the `-complete`
|
||||
// flag, because the package isn't made up of just '.go' files.
|
||||
// This allows Netstack to use the architecture-independent portions of this
|
||||
// package, because the architecture-dependent portions are never compiled in
|
||||
// the first place.
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2020 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
// //go:linkname directives type-checked by checklinkname.
|
||||
// Runtime type copies checked by checkoffset.
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
// This is mostly copied from the standard library's sync/rwmutex.go.
|
||||
//
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
package sync
|
||||
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// Copyright 2019 The gVisor Authors.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// license that can be found in the LICENSE file or at
|
||||
// https://developers.google.com/open-source/licenses/bsd.
|
||||
|
||||
// Package sync provides synchronization primitives.
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user