1// Copyright 2020 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build !goexperiment.staticlockranking
6
7package runtime
8
9const staticLockRanking = false
10
11// // lockRankStruct is embedded in mutex, but is empty when staticklockranking is
12// disabled (the default)
13type lockRankStruct struct {
14}
15
16func lockInit(l *mutex, rank lockRank) {
17}
18
19func getLockRank(l *mutex) lockRank {
20	return 0
21}
22
23func lockWithRank(l *mutex, rank lockRank) {
24	lock2(l)
25}
26
27// This function may be called in nosplit context and thus must be nosplit.
28//
29//go:nosplit
30func acquireLockRankAndM(rank lockRank) {
31	acquirem()
32}
33
34func unlockWithRank(l *mutex) {
35	unlock2(l)
36}
37
38// This function may be called in nosplit context and thus must be nosplit.
39//
40//go:nosplit
41func releaseLockRankAndM(rank lockRank) {
42	releasem(getg().m)
43}
44
45// This function may be called in nosplit context and thus must be nosplit.
46//
47//go:nosplit
48func lockWithRankMayAcquire(l *mutex, rank lockRank) {
49}
50
51//go:nosplit
52func assertLockHeld(l *mutex) {
53}
54
55//go:nosplit
56func assertRankHeld(r lockRank) {
57}
58
59//go:nosplit
60func worldStopped() {
61}
62
63//go:nosplit
64func worldStarted() {
65}
66
67//go:nosplit
68func assertWorldStopped() {
69}
70
71//go:nosplit
72func assertWorldStoppedOrLockHeld(l *mutex) {
73}
74