Black Lives Matter. Support the Equal Justice Initiative.

Source file src/runtime/lockrank_off.go

Documentation: runtime

     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  // +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  // The following functions may be called in nosplit context.
    22  // Nosplit is not strictly required for lockWithRank, unlockWithRank
    23  // and lockWithRankMayAcquire, but these nosplit annotations must
    24  // be kept consistent with the equivalent functions in lockrank_on.go.
    25  
    26  //go:nosplit
    27  func lockWithRank(l *mutex, rank lockRank) {
    28  	lock2(l)
    29  }
    30  
    31  //go:nosplit
    32  func acquireLockRank(rank lockRank) {
    33  }
    34  
    35  //go:nosplit
    36  func unlockWithRank(l *mutex) {
    37  	unlock2(l)
    38  }
    39  
    40  //go:nosplit
    41  func releaseLockRank(rank lockRank) {
    42  }
    43  
    44  //go:nosplit
    45  func lockWithRankMayAcquire(l *mutex, rank lockRank) {
    46  }
    47  

View as plain text