blob: c52ea0b8e4a540ea9ffc0f3b1ecf05a76d9131b2 [file] [log] [blame] [edit]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
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),
}
}