Skip to content

Commit

Permalink
removed sync.Mutex from properties type
Browse files Browse the repository at this point in the history
it's not necessary and in fact is an error to make copies of a
sync.Mutex due to how we're using instances of the properties type
  • Loading branch information
JetSetIlly committed May 29, 2024
1 parent fcb8439 commit 1f036eb
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions properties/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"os"
"strings"
"sync"

"github.com/jetsetilly/gopher2600/logger"
"github.com/jetsetilly/gopher2600/resources"
Expand All @@ -42,7 +41,6 @@ func (e Entry) IsValid() bool {
}

type Properties struct {
crit sync.Mutex
available bool
entries map[string]Entry
}
Expand Down Expand Up @@ -127,9 +125,6 @@ func Load() (Properties, error) {

// Find the property entry for the ROM with the supplied md5 hash
func (pro Properties) Lookup(md5Hash string) Entry {
pro.crit.TryLock()
defer pro.crit.Unlock()

if e, ok := pro.entries[md5Hash]; ok {
return e
}
Expand Down

0 comments on commit 1f036eb

Please sign in to comment.