locker.go 463 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //@File locker.go
  2. //@Time 2022/05/12
  3. //@Author #Suyghur,
  4. package sync
  5. import gosync "sync"
  6. type Locker interface {
  7. Lock()
  8. Unlock()
  9. RLock()
  10. RUnlock()
  11. }
  12. var _ Locker = (*gosync.RWMutex)(nil)
  13. type FakeLocker struct {
  14. }
  15. // Lock does nothing
  16. func (l FakeLocker) Lock() {
  17. }
  18. // Unlock does nothing
  19. func (l FakeLocker) Unlock() {
  20. }
  21. // RLock does nothing
  22. func (l FakeLocker) RLock() {
  23. }
  24. // RUnlock does nothing
  25. func (l FakeLocker) RUnlock() {
  26. }