Initial commit
parent
8cd82c9f95
commit
7052c12ae1
@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func a(c chan bool) {
|
||||
for i := 0; i < 50; i++ {
|
||||
fmt.Print("a")
|
||||
}
|
||||
|
||||
c <- true
|
||||
}
|
||||
|
||||
func b(c chan bool) {
|
||||
for i := 0; i < 50; i++ {
|
||||
fmt.Print("b")
|
||||
}
|
||||
|
||||
c <- true
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := make(chan bool)
|
||||
go a(c)
|
||||
go b(c)
|
||||
<- c
|
||||
<- c
|
||||
fmt.Println("end main()")
|
||||
}
|
||||
Loading…
Reference in New Issue