Skip to content

Commit

Permalink
domain: fix a data race (pingcap#2397)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and zimulala committed Jan 5, 2017
1 parent a44d9c3 commit a3b5a48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion domain/schema_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ func (s *schemaValidator) Check(txnTS uint64, schemaVer int64) bool {

// Latest returns the latest schema version it knows.
func (s *schemaValidator) Latest() int64 {
return s.latestSchemaVer
s.mux.RLock()
ret := s.latestSchemaVer
s.mux.RUnlock()
return ret
}

func extractPhysicalTime(ts uint64) time.Time {
Expand Down

0 comments on commit a3b5a48

Please sign in to comment.