Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the advantage of this library? #2

Open
giter opened this issue Oct 18, 2019 · 0 comments
Open

What's the advantage of this library? #2

giter opened this issue Oct 18, 2019 · 0 comments

Comments

@giter
Copy link

giter commented Oct 18, 2019

Why not just:

`
package multilock

import (
"strings"
"sync"
)

var mm = sync.Map{}

func New(id ...string) *sync.Mutex {

m, _ := mm.LoadOrStore(strings.Join(id, "ᚋ"), &sync.Mutex{})
return m.(*sync.Mutex)

}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant