better guardmany locking

This commit is contained in:
Radu Ioan Fericean
2014-01-10 19:02:40 +02:00
parent 9f125e638f
commit 8aafd0ec77

View File

@@ -81,7 +81,10 @@ func (cm *AccountLock) GuardMany(names []string, handler func() (float64, error)
cm.Unlock()
}
lock <- true
reply, err = handler()
}
reply, err = handler()
for _, name := range names {
lock := AccLock.queue[name]
<-lock
}
return