Source file src/runtime/lockrank_off.go

     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  // // lockRankStruct is embedded in mutex, but is empty when staticklockranking is
    10  // disabled (the default)
    11  type lockRankStruct struct {
    12  }
    13  
    14  func lockInit(l *mutex, rank lockRank) {
    15  }
    16  
    17  func getLockRank(l *mutex) lockRank {
    18  	return 0
    19  }
    20  
    21  func lockWithRank(l *mutex, rank lockRank) {
    22  	lock2(l)
    23  }
    24  
    25  // This function may be called in nosplit context and thus must be nosplit.
    26  //go:nosplit
    27  func acquireLockRank(rank lockRank) {
    28  }
    29  
    30  func unlockWithRank(l *mutex) {
    31  	unlock2(l)
    32  }
    33  
    34  // This function may be called in nosplit context and thus must be nosplit.
    35  //go:nosplit
    36  func releaseLockRank(rank lockRank) {
    37  }
    38  
    39  func lockWithRankMayAcquire(l *mutex, rank lockRank) {
    40  }
    41  
    42  //go:nosplit
    43  func assertLockHeld(l *mutex) {
    44  }
    45  
    46  //go:nosplit
    47  func assertRankHeld(r lockRank) {
    48  }
    49  
    50  //go:nosplit
    51  func worldStopped() {
    52  }
    53  
    54  //go:nosplit
    55  func worldStarted() {
    56  }
    57  
    58  //go:nosplit
    59  func assertWorldStopped() {
    60  }
    61  
    62  //go:nosplit
    63  func assertWorldStoppedOrLockHeld(l *mutex) {
    64  }
    65  

View as plain text