Guest User

Untitled

a guest
Jun 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. // PrioritizedEntity interface
  2. type PrioritizedEntity interface {
  3. GetPriority() int
  4. AccessResource(interface{})
  5. }
  6.  
  7. // GreedyMutex a mutex that handles greedy entities with higher priority
  8. type GreedyMutex struct {
  9. sync.Mutex
  10. TimeToWait time.Duration
  11. queue chan PrioritizedEntity
  12. }
Add Comment
Please, Sign In to add comment