You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lock.go 437B

12345678910111213141516171819202122232425
  1. package render
  2. import "sync"
  3. // rwLock represents an interface for sync.RWMutex.
  4. type rwLock interface {
  5. Lock()
  6. Unlock()
  7. RLock()
  8. RUnlock()
  9. }
  10. var (
  11. // Ensure our interface is correct.
  12. _ rwLock = &sync.RWMutex{}
  13. _ rwLock = emptyLock{}
  14. )
  15. // emptyLock is a noop RWLock implementation.
  16. type emptyLock struct{}
  17. func (emptyLock) Lock() {}
  18. func (emptyLock) Unlock() {}
  19. func (emptyLock) RLock() {}
  20. func (emptyLock) RUnlock() {}