Fix lock contention
This commit is contained in:
parent
ffb52af00b
commit
6513685520
2 changed files with 3 additions and 3 deletions
|
|
@ -255,7 +255,6 @@ func runIteratorOnSession(it graph.Iterator, ses *Session) {
|
|||
it, _ = it.Optimize()
|
||||
glog.V(2).Infoln(it.DebugString(0))
|
||||
for {
|
||||
// TODO(barakmich): Better halting.
|
||||
select {
|
||||
case <-ses.kill:
|
||||
return
|
||||
|
|
|
|||
|
|
@ -141,8 +141,9 @@ func (s *Session) runUnsafe(input interface{}) (otto.Value, error) {
|
|||
}
|
||||
|
||||
s.envLock.Lock()
|
||||
defer s.envLock.Unlock()
|
||||
return s.env.Run(input)
|
||||
env := s.env
|
||||
s.envLock.Unlock()
|
||||
return env.Run(input)
|
||||
}
|
||||
|
||||
func (s *Session) ExecInput(input string, out chan interface{}, limit int) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue