Get rid of an unneeded mutex.

This commit is contained in:
Daniel Jones 2013-08-05 07:32:21 -07:00
parent ce54fa1868
commit c44de7fb69
2 changed files with 1 additions and 5 deletions

4
mk.go
View file

@ -147,11 +147,11 @@ func mkNode(g *graph, u *node, dryrun bool, required bool) {
defer func() { defer func() {
u.mutex.Lock() u.mutex.Lock()
u.status = finalstatus u.status = finalstatus
u.mutex.Unlock()
for i := range u.listeners { for i := range u.listeners {
u.listeners[i] <- u.status u.listeners[i] <- u.status
} }
u.listeners = u.listeners[0:0] u.listeners = u.listeners[0:0]
u.mutex.Unlock()
}() }()
// there's no fucking rules, dude // there's no fucking rules, dude
@ -182,7 +182,6 @@ func mkNode(g *graph, u *node, dryrun bool, required bool) {
mkError(fmt.Sprintf("don't know how to make %s in %s", u.name, wd)) mkError(fmt.Sprintf("don't know how to make %s in %s", u.name, wd))
} }
e.r.mutex.Lock()
prereqs_required := required && (e.r.attributes.virtual || !u.exists) prereqs_required := required && (e.r.attributes.virtual || !u.exists)
mkNodePrereqs(g, u, e, prereqs, dryrun, prereqs_required) mkNodePrereqs(g, u, e, prereqs, dryrun, prereqs_required)
@ -234,7 +233,6 @@ func mkNode(g *graph, u *node, dryrun bool, required bool) {
} else if finalstatus != nodeStatusFailed { } else if finalstatus != nodeStatusFailed {
finalstatus = nodeStatusNop finalstatus = nodeStatusNop
} }
e.r.mutex.Unlock()
} }
func mkError(msg string) { func mkError(msg string) {

View file

@ -7,7 +7,6 @@ package main
import ( import (
"fmt" "fmt"
"regexp" "regexp"
"sync"
"unicode/utf8" "unicode/utf8"
) )
@ -58,7 +57,6 @@ type rule struct {
recipe string // recipe source recipe string // recipe source
command []string // command attribute command []string // command attribute
ismeta bool // is this a meta rule ismeta bool // is this a meta rule
mutex sync.Mutex // prevent the rule from being executed multiple times
file string // file where the rule is defined file string // file where the rule is defined
line int // line number on which the rule is defined line int // line number on which the rule is defined
} }