lib/model: Use a single lock (phase two: cleanup) (#9276)
Cleanup after #9275. This renames `fmut` -> `mut`, removes the deadlock detector and associated plumbing, renames some things from `...PRLocked` to `...RLocked` and similar, and updates comments. Apart from the removal of the deadlock detection machinery, no functional code changes... i.e. almost 100% diff noise, have fun reviewing.
This commit is contained in:
@@ -15,8 +15,6 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/sasha-s/go-deadlock"
|
||||
)
|
||||
|
||||
var timeNow = time.Now
|
||||
@@ -39,9 +37,6 @@ type WaitGroup interface {
|
||||
}
|
||||
|
||||
func NewMutex() Mutex {
|
||||
if useDeadlock {
|
||||
return &deadlock.Mutex{}
|
||||
}
|
||||
if debug {
|
||||
mutex := &loggedMutex{}
|
||||
mutex.holder.Store(holder{})
|
||||
@@ -51,9 +46,6 @@ func NewMutex() Mutex {
|
||||
}
|
||||
|
||||
func NewRWMutex() RWMutex {
|
||||
if useDeadlock {
|
||||
return &deadlock.RWMutex{}
|
||||
}
|
||||
if debug {
|
||||
mutex := &loggedRWMutex{
|
||||
readHolders: make(map[int][]holder),
|
||||
|
||||
Reference in New Issue
Block a user