Golang Cond同步机制
条件变量是构建在一个基础锁上的同步原语,Golang Crondition位于sync包中,用于goroutine需要关注特定的条件的场景。
Cond 模块定义:
type Cond struct {
noCopy noCopy
// L is held while observing or changing the condition
L Locker
notify notifyList
checker
条件变量是构建在一个基础锁上的同步原语,Golang Crondition位于sync包中,用于goroutine需要关注特定的条件的场景。
Cond 模块定义:
type Cond struct {
noCopy noCopy
// L is held while observing or changing the condition
L Locker
notify notifyList
checker