syncTest

package
v0.0.0-...-3b582b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

synchronous

实例

适用channel和mutex实现goroutine数据安全

适用场景

有些场景,比如不同的Goroutine之间进行通信,那么适用channel是最好不过了,但是再一些并发场景下使用channel来保证并发安全,那么性能表现肯定比不上Mutex。

Documentation

Index

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL