mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Remove dead code
This commit is contained in:
parent
cc619f6b53
commit
13d77f1557
@ -1,47 +0,0 @@
|
||||
// Copyright (C) 2014 Jakob Borg and Contributors (see the CONTRIBUTORS file).
|
||||
// All rights reserved. Use of this source code is governed by an MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//+build locktrace
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"path"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
lockTime time.Time
|
||||
)
|
||||
|
||||
func (m *Model) Lock() {
|
||||
_, file, line, _ := runtime.Caller(1)
|
||||
log.Printf("%s:%d: Lock()...", path.Base(file), line)
|
||||
blockTime := time.Now()
|
||||
m.RWMutex.Lock()
|
||||
lockTime = time.Now()
|
||||
log.Printf("%s:%d: ...Lock() [%.04f ms]", path.Base(file), line, time.Since(blockTime).Seconds()*1000)
|
||||
}
|
||||
|
||||
func (m *Model) Unlock() {
|
||||
_, file, line, _ := runtime.Caller(1)
|
||||
m.RWMutex.Unlock()
|
||||
log.Printf("%s:%d: Unlock() [%.04f ms]", path.Base(file), line, time.Since(lockTime).Seconds()*1000)
|
||||
}
|
||||
|
||||
func (m *Model) RLock() {
|
||||
_, file, line, _ := runtime.Caller(1)
|
||||
log.Printf("%s:%d: RLock()...", path.Base(file), line)
|
||||
blockTime := time.Now()
|
||||
m.RWMutex.RLock()
|
||||
log.Printf("%s:%d: ...RLock() [%.04f ms]", path.Base(file), line, time.Since(blockTime).Seconds()*1000)
|
||||
}
|
||||
|
||||
func (m *Model) RUnlock() {
|
||||
_, file, line, _ := runtime.Caller(1)
|
||||
m.RWMutex.RUnlock()
|
||||
log.Printf("%s:%d: RUnlock()", path.Base(file), line)
|
||||
}
|
Loading…
Reference in New Issue
Block a user