Skip to content

Commit

Permalink
Fix bug in lock() which was causing it to wait on an uninitialised ch…
Browse files Browse the repository at this point in the history
…annel when node doesn't exist.
  • Loading branch information
Dominic Wong committed Jun 26, 2013
1 parent 4bd73c7 commit f774f13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ func (l *Lock) Lock() error {
_, _, ch, err := l.c.GetW(l.path + "/" + prevSeqPath)
if err != nil && err != ErrNoNode {
return err
} else if err != nil && err == ErrNoNode {
// try again
continue
}

ev := <-ch
Expand Down

0 comments on commit f774f13

Please sign in to comment.