blob: 4e5a1b734ff4ca33fd18aaa15e6b12e6fe2086b5 [file] [log] [blame]
package concurrency
import (
"sync"
)
// context stores the abstract state of resources used in an execution
// of a concurrent program.
type context struct {
// mutexes stores the abstract state of mutexes.
mutexes map[*sync.Mutex]*fakeMutex
// rwMutexes stores the abstract state of read-write mutexes.
rwMutexes map[*sync.RWMutex]*fakeRWMutex
}
// newContext if the context factory.
func newContext() *context {
return &context{
mutexes: make(map[*sync.Mutex]*fakeMutex),
rwMutexes: make(map[*sync.RWMutex]*fakeRWMutex),
}
}