Исходники и презентации
This commit is contained in:
15
lessons/channels/select_with_main_goroutine/main.go
Normal file
15
lessons/channels/select_with_main_goroutine/main.go
Normal file
@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "runtime"
|
||||
|
||||
func doSomething() {
|
||||
for {
|
||||
runtime.Gosched()
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
go doSomething()
|
||||
go doSomething()
|
||||
select {}
|
||||
}
|
||||
Reference in New Issue
Block a user