func (s *SafeInt) Set(val int) int {
	s.Lock()
	defer s.Unlock()
	s.val = val
	return s.val
}
Set the value of the SafeInt
package util
import (
	"sync"
)
type SafeBool struct {
	val bool
	sync.Mutex
}
func (s *SafeBool) Get() bool {
	s.Lock()
	defer s.Unlock()
	return s.val
}
func (s *SafeBool) Set(newVal bool) {
	s.Lock()
	s.val = newVal
	s.Unlock()
}
type SafeError struct {
	val error
	sync.Mutex
}
func (s *SafeError) Get() error {
	s.Lock()
	defer s.Unlock()
	return s.val
}
func (s *SafeError) Set(newVal error) {
	s.Lock()
	s.val = newVal
	s.Unlock()
}
type SafeInt struct {
	val int
	sync.Mutex
}
func (s *SafeInt) Get() int {
	s.Lock()
	defer s.Unlock()
	return s.val
}
func (s *SafeInt) Add(addend int) int {
	s.Lock()
	defer s.Unlock()
	s.val += addend
	return s.val
}