mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
lib/sync: Fix broken build
This commit is contained in:
parent
da413b823b
commit
caaab462bc
@ -12,8 +12,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
"github.com/sasha-s/go-deadlock"
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -31,7 +31,10 @@ func init() {
|
||||
l.SetDebug("sync", strings.Contains(os.Getenv("STTRACE"), "sync") || os.Getenv("STTRACE") == "all")
|
||||
|
||||
if n, err := strconv.Atoi(os.Getenv("STLOCKTHRESHOLD")); err == nil {
|
||||
deadlock.Opts.DeadlockTimeout = threshold = time.Duration(n) * time.Millisecond
|
||||
threshold = time.Duration(n) * time.Millisecond
|
||||
}
|
||||
if n, err := strconv.Atoi(os.Getenv("STDEADLOCK")); err == nil {
|
||||
deadlock.Opts.DeadlockTimeout = time.Duration(n) * time.Second
|
||||
}
|
||||
l.Debugf("Enabling lock logging at %v threshold", threshold)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ type WaitGroup interface {
|
||||
|
||||
func NewMutex() Mutex {
|
||||
if useDeadlock {
|
||||
return deadlock.Mutex{}
|
||||
return &deadlock.Mutex{}
|
||||
}
|
||||
if debug {
|
||||
mutex := &loggedMutex{}
|
||||
@ -50,7 +50,7 @@ func NewMutex() Mutex {
|
||||
|
||||
func NewRWMutex() RWMutex {
|
||||
if useDeadlock {
|
||||
return deadlock.RWMutex{}
|
||||
return &deadlock.RWMutex{}
|
||||
}
|
||||
if debug {
|
||||
mutex := &loggedRWMutex{
|
||||
|
Loading…
Reference in New Issue
Block a user