27

不得不知道的golang之sync.Mutex互斥锁源码分析-梦朝思夕

 5 years ago
source link: http://blog.51cto.com/qiangmzsx/2134786
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.Mutex进行分析,与Golang1.10基本一样除了将panic改为了throw之外其他的都一样。源代码位置:sync\mutex.go。可以看到注释如下:Mutexcanbein2modesofoperations:normalandstarvation.InnormalmodewaitersarequeuedinFIFOorder,butawokenupwa

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK