Created
August 1, 2014 18:30
-
-
Save nelhage/a463344064003e462b1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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