doublelock

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

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

Go to latest
Published: Dec 19, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Edited = "Edited"
View Source
const M_Lock = "M_Lock"
View Source
const M_Unlock = "M_Unlock"
View Source
const MaxCallChainDepth int = 6 // Be careful: Algorithm complexity: e^n, n = C5_call_chain_layer
View Source
const MaxInspectedFun int = 100000
View Source
const RW_Lock = "RW_Lock"
View Source
const RW_RLock = "RW_RLock"
View Source
const RW_RUnlock = "RW_RUnlock"
View Source
const RW_Unlock = "RW_Unlock"
View Source
const Unknown = "Unknown"

Variables

View Source
var AnalyzedFNs map[string]bool
View Source
var MapMutex map[string]*StMutex
View Source
var VecFNsWithLocking []*ssa.Function

Functions

func CompareTwoMaps

func CompareTwoMaps(map1 map[*StLockingOp]bool, map2 map[*StLockingOp]bool) bool

func Detect

func Detect()

func GetLiveMutex

func GetLiveMutex(inputInst ssa.Instruction) map[*StLockingOp]bool

func InitBeforeAfterMap

func InitBeforeAfterMap(inputFn *ssa.Function, contextLock map[*StLockingOp]bool)

func InitGenKillMap

func InitGenKillMap(inputFn *ssa.Function)

func Initialize

func Initialize()

func KillKillSet

func KillKillSet(newbefore map[*StLockingOp]bool, pUnlocking *StUnlockingOp)

Types

type StDoubleLock

type StDoubleLock struct {
	PLock1 *StLockingOp
	PLock2 *StLockingOp
}

func GenKillAnalysis

func GenKillAnalysis(inputFn *ssa.Function, contextLock map[*StLockingOp]bool) []*StDoubleLock

func UnionGenSet

func UnionGenSet(newbefore map[*StLockingOp]bool, pLocking *StLockingOp) *StDoubleLock

type StLockingOp

type StLockingOp struct {
	StrName  string
	I        ssa.Instruction
	IsRWLock bool
	IsDefer  bool

	Parent *StMutex

	StrFileName string
	NumLine     int
}

type StMutex

type StMutex struct {
	StrName         string
	StrType         string
	MapLockingOps   map[ssa.Instruction]*StLockingOp
	MapUnlockingOps map[ssa.Instruction]*StUnlockingOp
	Pkg             string // Don't use *ssa.Package here! It's not reliable

	StrStatus string
}

type StUnlockingOp

type StUnlockingOp struct {
	StrName  string
	I        ssa.Instruction
	IsRWLock bool
	IsDefer  bool

	Parent *StMutex
}

Jump to

Keyboard shortcuts

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