6 ms·
Under the "Better parallelisation" section, you don't need to proxy methods for your sync.Mutex if you embed the type. type FileReader struct { Fi
by devjam 7y ago
Under the "Better parallelisation" section, you don't need to proxy methods for your sync.Mutex if you embed the type.
type FileReader struct {
File *os.File
LastCharIsSpace bool
sync.Mutex
}
And your Lock() and Unlock() calls on FileReader would just work.
- ajeetdsouza 7y agoFixed, thank you!