Skip to content

Instantly share code, notes, and snippets.

@nelhage
Created August 1, 2014 18:30
Show Gist options
  • Save nelhage/a463344064003e462b1c to your computer and use it in GitHub Desktop.
Save nelhage/a463344064003e462b1c to your computer and use it in GitHub Desktop.
type MyThing struct {
sync.Mutex
}
type ThingBucket {
things []MyThing
}
func doStuff(b *ThingBucket) {
for _, t := range(b.things) {
t.Lock()
doStuffTo(t)
t.Unlock()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment