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  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 acquireLockRankAndM(rank lockRank) {
    31  	acquirem()
    32  }
    33  
    34  func 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
    41  func releaseLockRankAndM(rank lockRank) {
    42  	releasem(getg().m)
    43  }
    44  
    45  func lockWithRankMayAcquire(l *mutex, rank lockRank) {
    46  }
    47  
    48  //go:nosplit
    49  func assertLockHeld(l *mutex) {
    50  }
    51  
    52  //go:nosplit
    53  func assertRankHeld(r lockRank) {
    54  }
    55  
    56  //go:nosplit
    57  func worldStopped() {
    58  }
    59  
    60  //go:nosplit
    61  func worldStarted() {
    62  }
    63  
    64  //go:nosplit
    65  func assertWorldStopped() {
    66  }
    67  
    68  //go:nosplit
    69  func assertWorldStoppedOrLockHeld(l *mutex) {
    70  }
    71  

View as plain text