Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PrioritizedEntity interface
- type PrioritizedEntity interface {
- GetPriority() int
- AccessResource(interface{})
- }
- // GreedyMutex a mutex that handles greedy entities with higher priority
- type GreedyMutex struct {
- sync.Mutex
- TimeToWait time.Duration
- queue chan PrioritizedEntity
- }
Add Comment
Please, Sign In to add comment