concurrency

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit()

Exit implements the logic related to modeling and scheduling thread termination.

func Finish

func Finish()

Cleanup destroys the existing instance of the tester.

func Start

func Start(fn func())

Start implements the logic related to modeling and scheduling an execution of "go fn()".

func TIDGenerator

func TIDGenerator() func() TID

TIDGenerator is used for generating unique thread identifiers.

Types

type IncreasingDepth

type IncreasingDepth []*state

IncreasingDepth is used to sort states in the increasing order of their depth.

func (IncreasingDepth) Len

func (states IncreasingDepth) Len() int

func (IncreasingDepth) Less

func (states IncreasingDepth) Less(i, j int) bool

func (IncreasingDepth) Swap

func (states IncreasingDepth) Swap(i, j int)

type IncreasingTID

type IncreasingTID []TID

Increasing is used to sort thread identifiers in an increasing order.

func (IncreasingTID) Len

func (tids IncreasingTID) Len() int

func (IncreasingTID) Less

func (tids IncreasingTID) Less(i, j int) bool

func (IncreasingTID) Swap

func (tids IncreasingTID) Swap(i, j int)

type TID

type TID int

TID is the thread identifier type.

type Tester

type Tester struct {
	// contains filtered or unexported fields
}

Tester represents an instance of the systematic test.

func Init

func Init(setup, body, cleanup func()) *Tester

Setup sets up a new instance of the tester.

func T

func T() *Tester

T returns the global instance of the tester.

func (*Tester) Explore

func (t *Tester) Explore() (int, error)

Explore explores the space of possible test schedules until the state space is fully exhausted.

func (*Tester) ExploreFor

func (t *Tester) ExploreFor(d time.Duration) (int, error)

ExploreFor explores the space of possible test schedules until the state space is fully exhausted or the given duration elapses, whichever occurs first.

func (*Tester) ExploreN

func (t *Tester) ExploreN(n int) (int, error)

ExploreN explores the space of possible test schedules until the state space is fully exhausted or the given number of schedules is explored, whichever occurs first.

func (*Tester) MutexLock

func (t *Tester) MutexLock(m *sync.Mutex)

MutexLock implements the logic related to modeling and scheduling an execution of "m.Lock()".

func (*Tester) MutexUnlock

func (t *Tester) MutexUnlock(m *sync.Mutex)

MutexUnlock implements the logic related to modeling and scheduling an execution of "m.Unlock()".

func (*Tester) RWMutexLock

func (t *Tester) RWMutexLock(rw *sync.RWMutex)

RWMutexLock implements the logic related to modeling and scheduling an execution of "rw.Lock()".

func (*Tester) RWMutexRLock

func (t *Tester) RWMutexRLock(rw *sync.RWMutex)

RWMutexRLock implements the logic related to modeling and scheduling an execution of "rw.RLock()".

func (*Tester) RWMutexRUnlock

func (t *Tester) RWMutexRUnlock(rw *sync.RWMutex)

RWMutexRUnlock implements the logic related to modeling and scheduling an execution of "rw.RUnlock()".

func (*Tester) RWMutexUnlock

func (t *Tester) RWMutexUnlock(rw *sync.RWMutex)

RWMutexUnlock implements the logic related to modeling and scheduling an execution of "rw.Unlock()".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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