sync

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

* 并发共享函数调用返回的库

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartDeadCheck added in v0.4.3

func StartDeadCheck(lockNotify func(deadLockInfo []byte), checkInterval, maxLockInterval time.Duration, debugLog func(panicMsg bool, format string, data ...interface{}))

func StopDeadCheck added in v0.4.3

func StopDeadCheck()

Types

type LockInfo

type LockInfo struct {
	IsRLock      bool //是否是RLock
	LockStyle    LockStyle
	CheckIndex   byte //检查了多少次
	StartTime    time.Time
	GoRoutine    int64
	LockMsg      string
	Caller       string //调用Lock的位置
	CallerFunc   string //调用Lock的函数
	BeforeCaller string //前一步调用
	BeforeFunc   string //前一步调用
	Owner        *mutexStruct
}

func (*LockInfo) String

func (lckInfo *LockInfo) String() string

type LockStyle

type LockStyle uint8
const (
	LckUnLock    LockStyle = iota
	LckLockBlock           //LockWait
	LckLocking             //Locking
)

type MutexEx

type MutexEx struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*MutexEx) Lock

func (mutex *MutexEx) Lock()

func (*MutexEx) LockWithMsg added in v0.4.3

func (mutex *MutexEx) LockWithMsg(lockMsg string)

func (*MutexEx) Unlock

func (mutex *MutexEx) Unlock()

type RWMutexEx

type RWMutexEx struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*RWMutexEx) Lock

func (mutex *RWMutexEx) Lock()

func (*RWMutexEx) LockWithMsg added in v0.4.3

func (mutex *RWMutexEx) LockWithMsg(lockMsg string)

func (*RWMutexEx) RLock

func (mutex *RWMutexEx) RLock()

func (*RWMutexEx) RLockWithMsg added in v0.4.3

func (mutex *RWMutexEx) RLockWithMsg(lockMsg string)

func (*RWMutexEx) RUnlock

func (mutex *RWMutexEx) RUnlock()

func (*RWMutexEx) Unlock

func (mutex *RWMutexEx) Unlock()

type ShareCalls added in v0.4.3

type ShareCalls struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ShareCalls) ShareCall added in v0.4.3

func (calls *ShareCalls) ShareCall(shareID int, fn func(...interface{}) (interface{}, error), params ...interface{}) (result interface{}, fromShareCache bool, err error)

func (*ShareCalls) ShareCallByKey added in v0.4.3

func (calls *ShareCalls) ShareCallByKey(sharekey string, fn func(...interface{}) (interface{}, error), params ...interface{}) (result interface{}, fromShareCache bool, err error)

Jump to

Keyboard shortcuts

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