tagspa
go的鎖機制-sync.Mutexcode
sync.Mutex
var lock *sync.Mutex = &sync.Mutex {} io
( 1 )class
lock.Lock()margin
defer lock.Unlock()word
( 2 )di
once.Do(func() { m = &Manager {} })co