Merge pull request #14 from jessta/master

Add missing defers on mutex.Unlock()s
pull/820/head
Ben Johnson 2013-05-25 07:00:01 -07:00
commit e2cd96fd87
1 changed files with 2 additions and 2 deletions

View File

@ -107,14 +107,14 @@ func (s *Server) LogPath() string {
// Retrieves the current state of the server.
func (s *Server) State() string {
s.mutex.Lock()
s.mutex.Unlock()
defer s.mutex.Unlock()
return s.state
}
// Retrieves the name of the candidate this server voted for in this term.
func (s *Server) VotedFor() string {
s.mutex.Lock()
s.mutex.Unlock()
defer s.mutex.Unlock()
return s.votedFor
}