Switch to sync.RWMutex globally #30
Closed
opened 2 years ago by makeworld-the-better-one
·
1 comments
Loading…
Reference in new issue
There is no content yet.
Delete Branch '%!s(MISSING)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I've noticed pretty much of all of the library functions use a
sync.Mutex
to ensure safe concurrency, which is great. But I was thinking that usingsync.RWMutex
would be better in all cases, since the mutex is invoked even when simply getting/reading a variable. Usingsync.RWMutex
and changing relevant lines toRLock
andRUnlock
would make the code more efficient.Thanks!