Skip to content

Commit

Permalink
use simple mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdata committed Jan 25, 2024
1 parent 2492a5b commit dfff6c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions string.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// String wraps a mutex and a string, and implements jaws.StringSetter and jaws.HtmlGetter.
// String.JawsGetHtml() will escape the string before returning it.
type String struct {
mu sync.RWMutex
mu sync.Mutex
Value string
}

Expand All @@ -20,9 +20,9 @@ func (s *String) Set(val string) {
}

func (s *String) Get() (val string) {
s.mu.RLock()
s.mu.Lock()
val = s.Value
s.mu.RUnlock()
s.mu.Unlock()
return
}

Expand Down

0 comments on commit dfff6c9

Please sign in to comment.