55

Golang WaitGroup源码分析-梦朝思夕

 6 years ago
source link: http://blog.51cto.com/qiangmzsx/2097410
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
针对Golang1.9的sync.WaitGroup进行分析,与Golang1.10基本一样除了将panic改为了throw之外其他的都一样。源代码位置:sync\waitgroup.go。结构体typeWaitGroupstruct{noCopynoCopy//noCopy可以嵌入到结构中,在第一次使用后不可复制,使用govet作为检测使用//位值:高32位是计数器,低32位是goroution

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK