diff --git a/protocol/czar/err.go b/protocol/czar/err.go index 92d412e..a6263ea 100644 --- a/protocol/czar/err.go +++ b/protocol/czar/err.go @@ -6,7 +6,7 @@ import ( // Err is an object that will only store an error once. type Err struct { - mux sync.Mutex // Guards following + mux *sync.Mutex // Guards following err error sig chan struct{} } @@ -36,7 +36,7 @@ func (e *Err) Sig() <-chan struct{} { func NewErr() *Err { return &Err{ - mux: sync.Mutex{}, + mux: &sync.Mutex{}, err: nil, sig: make(chan struct{}), } diff --git a/protocol/czar/priority.go b/protocol/czar/priority.go index ed776ce..8e0df12 100644 --- a/protocol/czar/priority.go +++ b/protocol/czar/priority.go @@ -6,9 +6,9 @@ import ( // Priority implement a lock with three priorities. type Priority struct { - l sync.Mutex - m sync.Mutex - h sync.Mutex + l *sync.Mutex + m *sync.Mutex + h *sync.Mutex } // H executes function f with 0 priority. @@ -41,8 +41,8 @@ func (p *Priority) L(f func() error) error { // NewPriority returns a new Priority. func NewPriority() *Priority { return &Priority{ - l: sync.Mutex{}, - m: sync.Mutex{}, - h: sync.Mutex{}, + l: &sync.Mutex{}, + m: &sync.Mutex{}, + h: &sync.Mutex{}, } }