Lock tracing, fixes

This commit is contained in:
Jakob Borg
2013-12-24 20:31:25 -05:00
parent 4151972d3e
commit cf04e101b9
2 changed files with 46 additions and 9 deletions

View File

@@ -233,16 +233,10 @@ func (m *Model) ReplaceLocal(fs []File) {
m.recomputeGlobal()
m.recomputeNeed()
m.updated = time.Now().Unix()
m.broadcastIndex()
m.lastIdxBcastRequest = time.Now()
}
}
func (m *Model) broadcastIndex() {
m.Lock()
defer m.Unlock()
m.lastIdxBcastRequest = time.Now()
}
func (m *Model) broadcastIndexLoop() {
for {
m.RLock()
@@ -263,7 +257,7 @@ func (m *Model) broadcastIndexLoop() {
m.lastIdxBcast = time.Now()
}
m.RUnlock()
time.Sleep(idxBcastHoldtime)
time.Sleep(idxBcastHoldtime / 2)
}
}
@@ -300,7 +294,7 @@ func (m *Model) UpdateLocal(f File) {
m.recomputeGlobal()
m.recomputeNeed()
m.updated = time.Now().Unix()
m.broadcastIndex()
m.lastIdxBcastRequest = time.Now()
}
}