README ¶ synchronous 实例 适用channel和mutex实现goroutine数据安全 适用场景 有些场景,比如不同的Goroutine之间进行通信,那么适用channel是最好不过了,但是再一些并发场景下使用channel来保证并发安全,那么性能表现肯定比不上Mutex。 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func UseChan() func UseMutex() type Lock func NewLock() *Lock func (t *Lock) Lock() func (t *Lock) Unlock() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func UseChan ¶ func UseChan() func UseMutex ¶ func UseMutex() Types ¶ type Lock ¶ type Lock struct { // contains filtered or unexported fields } func NewLock ¶ func NewLock() *Lock func (*Lock) Lock ¶ func (t *Lock) Lock() func (*Lock) Unlock ¶ func (t *Lock) Unlock() Source Files ¶ View all Source files channel.go mutex.go Click to show internal directories. Click to hide internal directories.