tag
go的锁机制-sync.Mutex
var lock *sync.Mutex = &sync.Mutex {}
( 1 )
lock.Lock()
defer lock.Unlock()
( 2 )
once.Do(func() { m = &Manager {} })
tag
go的锁机制-sync.Mutex
var lock *sync.Mutex = &sync.Mutex {}
( 1 )
lock.Lock()
defer lock.Unlock()
( 2 )
once.Do(func() { m = &Manager {} })
转载于:https://www.cnblogs.com/ktmtwm/p/10455807.html