Skip to content

Commit

Permalink
2024-08-26 22:42:38
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Aug 26, 2024
1 parent b3819fe commit 4bdbe93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions protocol/czar/err.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}
Expand Down Expand Up @@ -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{}),
}
Expand Down
12 changes: 6 additions & 6 deletions protocol/czar/priority.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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{},
}
}

0 comments on commit 4bdbe93

Please sign in to comment.