Skip to content

Commit

Permalink
Remove mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
tino committed Dec 6, 2017
1 parent 23546e1 commit 1fae4c4
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions route/no_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package route

import (
"log"
"sync"
"sync/atomic"
)

Expand All @@ -24,15 +23,9 @@ func GetHTML() string {
return store.Load().(HTML).value
}

// hmu guards the atomic writes in SetHTML.
var hmu sync.Mutex

// SetHTML sets the current noroute html. The function is safe to be called from
// multiple goroutines.
func SetHTML(h string) {
hmu.Lock()
defer hmu.Unlock()

html := HTML{h}
store.Store(html)

Expand Down

0 comments on commit 1fae4c4

Please sign in to comment.