Skip to content

Instantly share code, notes, and snippets.

@deivinsontejeda
Created March 22, 2015 21:28
Show Gist options
  • Save deivinsontejeda/437faed7c9256d4b19c3 to your computer and use it in GitHub Desktop.
Save deivinsontejeda/437faed7c9256d4b19c3 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
const (
GOROTUNIES = 2
)
func run(id int, done chan bool) {
fmt.Printf("Hi, I'm thread %d\n", id)
done <- true
}
func main() {
done := make(chan bool, 1)
for i := 0; i < GOROTUNIES; i++ {
go run(i, done)
}
<-done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment