Исходники и презентации
This commit is contained in:
14
lessons/sync_primitives/wait_group_copying/main.go
Normal file
14
lessons/sync_primitives/wait_group_copying/main.go
Normal file
@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import "sync"
|
||||
|
||||
func done(wg sync.WaitGroup) {
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func main() {
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
done(wg)
|
||||
wg.Wait()
|
||||
}
|
||||
Reference in New Issue
Block a user