mutex.go 610 B

1234567891011121314151617181920212223
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. //go:build !ts_mutex_debug
  4. package syncs
  5. import "sync"
  6. // Mutex is an alias for sync.Mutex.
  7. //
  8. // It's only not a sync.Mutex when built with the ts_mutex_debug build tag.
  9. type Mutex = sync.Mutex
  10. // RWMutex is an alias for sync.RWMutex.
  11. //
  12. // It's only not a sync.RWMutex when built with the ts_mutex_debug build tag.
  13. type RWMutex = sync.RWMutex
  14. // RequiresMutex declares the caller assumes it has the given
  15. // mutex held. In non-debug builds, it's a no-op and compiles to
  16. // nothing.
  17. func RequiresMutex(mu *sync.Mutex) {}