Remove unnecessary server locks.

pull/820/head
Ben Johnson 2013-06-26 12:38:39 -06:00
parent 46fb02f191
commit 0bd3c9b1cd
1 changed files with 0 additions and 6 deletions

View File

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