From ecb7b3f65d65703332a8d356626b518ec5770a2e Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 11 Jun 2017 12:47:04 +0300 Subject: [PATCH] Unnecessary locking during toss: operations are already atomic --- src/cypherpunks.ru/nncp/toss.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/cypherpunks.ru/nncp/toss.go b/src/cypherpunks.ru/nncp/toss.go index fec62ae..2fb4cbb 100644 --- a/src/cypherpunks.ru/nncp/toss.go +++ b/src/cypherpunks.ru/nncp/toss.go @@ -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()) -- 2.48.1