github.com/twelsh-aw/go/src@v0.0.0-20230516233729-a56fe86a7c81/runtime/lockrank_off.go (about) 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 7 package runtime 8 9 const staticLockRanking = false 10 11 // // lockRankStruct is embedded in mutex, but is empty when staticklockranking is 12 // disabled (the default) 13 type lockRankStruct struct { 14 } 15 16 func lockInit(l *mutex, rank lockRank) { 17 } 18 19 func getLockRank(l *mutex) lockRank { 20 return 0 21 } 22 23 func 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 30 func acquireLockRank(rank lockRank) { 31 } 32 33 func unlockWithRank(l *mutex) { 34 unlock2(l) 35 } 36 37 // This function may be called in nosplit context and thus must be nosplit. 38 // 39 //go:nosplit 40 func releaseLockRank(rank lockRank) { 41 } 42 43 func lockWithRankMayAcquire(l *mutex, rank lockRank) { 44 } 45 46 //go:nosplit 47 func assertLockHeld(l *mutex) { 48 } 49 50 //go:nosplit 51 func assertRankHeld(r lockRank) { 52 } 53 54 //go:nosplit 55 func worldStopped() { 56 } 57 58 //go:nosplit 59 func worldStarted() { 60 } 61 62 //go:nosplit 63 func assertWorldStopped() { 64 } 65 66 //go:nosplit 67 func assertWorldStoppedOrLockHeld(l *mutex) { 68 }