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:
Jakob Borg
2023-12-11 22:06:45 +01:00
committed by GitHub
parent d21a2de055
commit 935a28c961
13 changed files with 210 additions and 396 deletions
+1 -9
View File
@@ -11,7 +11,6 @@ import (
"strconv"
"time"
deadlock "github.com/sasha-s/go-deadlock"
"github.com/syncthing/syncthing/lib/logger"
)
@@ -22,8 +21,7 @@ var (
// We make an exception in this package and have an actual "if debug { ...
// }" variable, as it may be rather performance critical and does
// nonstandard things (from a debug logging PoV).
debug = logger.DefaultLogger.ShouldDebug("sync")
useDeadlock = false
debug = logger.DefaultLogger.ShouldDebug("sync")
)
func init() {
@@ -31,10 +29,4 @@ func init() {
threshold = time.Duration(n) * time.Millisecond
}
l.Debugf("Enabling lock logging at %v threshold", threshold)
if n, _ := strconv.Atoi(os.Getenv("STDEADLOCKTIMEOUT")); n > 0 {
deadlock.Opts.DeadlockTimeout = time.Duration(n) * time.Second
l.Debugf("Enabling lock deadlocking at %v", deadlock.Opts.DeadlockTimeout)
useDeadlock = true
}
}