]> Cypherpunks.ru repositories - nncp.git/commitdiff
Unnecessary locking during toss: operations are already atomic
authorSergey Matveev <stargrave@stargrave.org>
Sun, 11 Jun 2017 09:47:04 +0000 (12:47 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 11 Jun 2017 09:47:28 +0000 (12:47 +0300)
src/cypherpunks.ru/nncp/toss.go

index fec62ae365a2c105e36f40b626298879ee13eca5..2fb4cbb034b47b1c549f92bfda036e6433182a8c 100644 (file)
@@ -48,11 +48,6 @@ func newNotification(fromTo *FromToYAML, subject string) io.Reader {
 }
 
 func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun bool) bool {
-       dirLock, err := ctx.LockDir(nodeId, TRx)
-       if err != nil {
-               return false
-       }
-       defer ctx.UnlockDir(dirLock)
        isBad := false
        for job := range ctx.Jobs(nodeId, TRx) {
                pktName := filepath.Base(job.Fd.Name())